APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.maps.objects

public Class TextMapObject

extends MapObject
Class Inheritance
Imports
com.badlogic.gdx.maps.MapObject, com.badlogic.gdx.math.Rectangle

@brief Represents a text map object

Field Summary

Modifier and TypeField and Description
private boolean
private String
private String
private boolean
private boolean
private int
private Rectangle
private float
private boolean
private String
private boolean
private String
private boolean

Constructor Summary

AccessConstructor and Description
public
TextMapObject()

Creates an empty text object with bounds starting in the lower left corner at (0, 0) with width=1 and height=1

public
TextMapObject(float
X coordinate
x
,
float
Y coordinate
y
,
float
width of the object bounds
width
,
float
height of the object bounds
height
,
String
a String representing the text for display
text
)

Creates a TextMapObject, represents a text map object

Method Summary

Modifier and TypeMethod and Description
public String
getFontFamily()

Returns: font family

public float
getHeight()

Returns: object's bounds height

public String
getHorizontalAlign()

Returns: A String describing object's horizontal alignment

public int
getPixelSize()

Returns: font pixel size

public Rectangle
getRectangle()

Returns: rectangle representing object bounds

public float
getRotation()

Returns: object's rotation

public String
getText()

Returns: object's text

public String
getVerticalAlign()

Returns: String describing object's vertical alignment

public float
getWidth()

Returns: object's bounds height

public float
getX()

Returns: object's X coordinate

public float
getY()

Returns: object's Y coordinate

public boolean
isBold()

Returns: true if the font is bold

public boolean
isItalic()

Returns: true if the font is italic

public boolean
isKerning()

Returns: true if kerning is enabled

public boolean
isStrikeout()

Returns: true if the font is strikeout

public boolean
isUnderline()

Returns: true if the font is underlined

public boolean
isWrap()

Returns: true if text wrapping is enabled

public void
setBold(boolean
set font to bold or not
bold
)

public void
setFontFamily(String
new font family
fontFamily
)

public void
setHorizontalAlign(String
the horizontal alignment string from Tiled
horizontalAlign
)

public void
setItalic(boolean
set font to italic or not
italic
)

public void
setKerning(boolean
enable or disable kerning
kerning
)

public void
setPixelSize(int
the pixel size for the font
pixelSize
)

public void
setRotation(float
new rotation value for the object
rotation
)

public void
setStrikeout(boolean
set font to strikeout or not
strikeout
)

public void
setText(String
new text to display
text
)

public void
setUnderline(boolean
set font to underline or not
underline
)

public void
setVerticalAlign(String
the vertical alignment string from Tiled
verticalAlign
)

public void
setWrap(boolean
enable or disable text wrapping
wrap
)

Inherited from com.badlogic.gdx.maps.MapObject:
getColorgetNamegetOpacitygetPropertiesisVisiblesetColorsetNamesetOpacitysetVisible

Field Detail

boldback to summary
private boolean bold
fontFamilyback to summary
private String fontFamily
horizontalAlignback to summary
private String horizontalAlign
italicback to summary
private boolean italic
kerningback to summary
private boolean kerning
pixelSizeback to summary
private int pixelSize
rectangleback to summary
private Rectangle rectangle
rotationback to summary
private float rotation
strikeoutback to summary
private boolean strikeout
textback to summary
private String text
underlineback to summary
private boolean underline
verticalAlignback to summary
private String verticalAlign
wrapback to summary
private boolean wrap

Constructor Detail

TextMapObjectback to summary
public TextMapObject()

Creates an empty text object with bounds starting in the lower left corner at (0, 0) with width=1 and height=1

TextMapObjectback to summary
public TextMapObject(float x, float y, float width, float height, String text)

Creates a TextMapObject, represents a text map object

Parameters
x:float

X coordinate

y:float

Y coordinate

width:float

width of the object bounds

height:float

height of the object bounds

text:String

a String representing the text for display

Method Detail

getFontFamilyback to summary
public String getFontFamily()
Returns:String

font family

getHeightback to summary
public float getHeight()
Returns:float

object's bounds height

getHorizontalAlignback to summary
public String getHorizontalAlign()
Returns:String

A String describing object's horizontal alignment

getPixelSizeback to summary
public int getPixelSize()
Returns:int

font pixel size

getRectangleback to summary
public Rectangle getRectangle()
Returns:Rectangle

rectangle representing object bounds

getRotationback to summary
public float getRotation()
Returns:float

object's rotation

getTextback to summary
public String getText()
Returns:String

object's text

getVerticalAlignback to summary
public String getVerticalAlign()
Returns:String

String describing object's vertical alignment

getWidthback to summary
public float getWidth()
Returns:float

object's bounds height

getXback to summary
public float getX()
Returns:float

object's X coordinate

getYback to summary
public float getY()
Returns:float

object's Y coordinate

isBoldback to summary
public boolean isBold()
Returns:boolean

true if the font is bold

isItalicback to summary
public boolean isItalic()
Returns:boolean

true if the font is italic

isKerningback to summary
public boolean isKerning()
Returns:boolean

true if kerning is enabled

isStrikeoutback to summary
public boolean isStrikeout()
Returns:boolean

true if the font is strikeout

isUnderlineback to summary
public boolean isUnderline()
Returns:boolean

true if the font is underlined

isWrapback to summary
public boolean isWrap()
Returns:boolean

true if text wrapping is enabled

setBoldback to summary
public void setBold(boolean bold)
Parameters
bold:boolean

set font to bold or not

setFontFamilyback to summary
public void setFontFamily(String fontFamily)
Parameters
fontFamily:String

new font family

setHorizontalAlignback to summary
public void setHorizontalAlign(String horizontalAlign)
Parameters
horizontalAlign:String

the horizontal alignment string from Tiled

setItalicback to summary
public void setItalic(boolean italic)
Parameters
italic:boolean

set font to italic or not

setKerningback to summary
public void setKerning(boolean kerning)
Parameters
kerning:boolean

enable or disable kerning

setPixelSizeback to summary
public void setPixelSize(int pixelSize)
Parameters
pixelSize:int

the pixel size for the font

setRotationback to summary
public void setRotation(float rotation)
Parameters
rotation:float

new rotation value for the object

setStrikeoutback to summary
public void setStrikeout(boolean strikeout)
Parameters
strikeout:boolean

set font to strikeout or not

setTextback to summary
public void setText(String text)
Parameters
text:String

new text to display

setUnderlineback to summary
public void setUnderline(boolean underline)
Parameters
underline:boolean

set font to underline or not

setVerticalAlignback to summary
public void setVerticalAlign(String verticalAlign)
Parameters
verticalAlign:String

the vertical alignment string from Tiled

setWrapback to summary
public void setWrap(boolean wrap)
Parameters
wrap:boolean

enable or disable text wrapping