Documentation

Text extends DrawObject

Representation of a text inside a object layer.

This class represents a text inside an object layer.

Tags
see
https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#text

Documentation

Table of Contents

$bold  : bool
Whether the font is bold (1) or not (0). (defaults to 0).
$color  : string
Color of the text in #AARRGGBB or #RRGGBB format (defaults to #000000).
$fontFamily  : string
The font family used (defaults to “sans-serif”).
$gid  : int|null
A reference to a tile.
$hAlign  : string
Horizontal alignment of the text within the object (left, center, right or justify, defaults to left) (since Tiled 1.2.1).
$height  : float
The height of the object in pixels.
$id  : int|null
Unique ID of the object.
$italic  : bool
Whether the font is italic (1) or not (0). (defaults to 0).
$kerning  : bool
Whether kerning should be used while rendering the text (1) or not (0). (defaults to 1).
$name  : string|null
The name of the object.
$pixelSize  : int
The size of the font in pixels (not using points, because other sizes in the TMX format are also using pixels) (defaults to 16).
$propertyBag  : PropertyBag|null
$rotation  : string
The rotation of the object in degrees clockwise around (x, y).
$strikeOut  : bool
Whether a line should be drawn through the text (1) or not (0). (defaults to 0).
$text  : string
Contains the actual text as character data.
$type  : string|null
The type of the object.
$underline  : bool
Whether a line should be drawn below the text (1) or not (0). (defaults to 0).
$vAlign  : string
Vertical alignment of the text within the object (top , center or bottom, defaults to top).
$visible  : bool
Whether the object is shown (1) or hidden (0).
$width  : float
The width of the object in pixels.
$wrap  : bool
Whether word wrapping is enabled (1) or disabled (0). (defaults to 0).
$x  : float
The x coordinate of the object in pixels.
$y  : float
The y coordinate of the object in pixels.
getColor()  : string
getFontFamily()  : string
getGid()  : int|null
getHAlign()  : string
getHeight()  : float
getId()  : int|null
getName()  : string|null
getPixelSize()  : int
getPropertyBag()  : PropertyBag|null
getRotation()  : string
getText()  : string
getType()  : string|null
getVAlign()  : string
getWidth()  : float
getX()  : float
getY()  : float
isBold()  : bool
isItalic()  : bool
isKerning()  : bool
isStrikeOut()  : bool
isUnderline()  : bool
isVisible()  : bool
isWrap()  : bool
setBold()  : Text
setColor()  : Text
setFontFamily()  : Text
setGid()  : DrawObject
setHAlign()  : Text
setHeight()  : DrawObject
setId()  : DrawObject
setItalic()  : Text
setKerning()  : Text
setName()  : DrawObject
setPixelSize()  : Text
setPropertyBag()  : self
setRotation()  : DrawObject
setStrikeOut()  : Text
setText()  : Text
setType()  : DrawObject
setUnderline()  : Text
setVAlign()  : Text
setVisible()  : DrawObject
setWidth()  : DrawObject
setWrap()  : Text
setX()  : DrawObject
setY()  : DrawObject

Properties

$hAlign

Horizontal alignment of the text within the object (left, center, right or justify, defaults to left) (since Tiled 1.2.1).

private string $hAlign = 'left'
Tags
see
Text::getHAlign()
see
Text::setHAlign()

Methods

getColor()

public getColor() : string
Tags
see
Text::$color
Return values
string

getGid()

public getGid() : int|null
Return values
int|null

getHeight()

public getHeight() : float
Return values
float

getId()

public getId() : int|null
Return values
int|null

getName()

public getName() : string|null
Return values
string|null

getRotation()

public getRotation() : string
Return values
string

getText()

public getText() : string
Tags
see
Text::$text
Return values
string

getType()

public getType() : string|null
Return values
string|null

getWidth()

public getWidth() : float
Return values
float

getX()

public getX() : float
Return values
float

getY()

public getY() : float
Return values
float

isVisible()

public isVisible() : bool
Return values
bool

Search results