Text

indigo.shared.scenegraph.Text
See theText companion object
final case class Text[M <: Material](text: String, alignment: TextAlignment, fontKey: FontKey, lineHeight: Int, letterSpacing: Int, material: M, eventHandlerEnabled: Boolean, eventHandler: ((Text[_], GlobalEvent)) => Option[GlobalEvent], position: Point, rotation: Radians, scale: Vector2, depth: Depth, ref: Point, flip: Flip) extends DependentNode[Text[M]], SpatialModifiers[Text[M]]

Used to draw text onto the screen based on font sprite sheets (images / textures) and a character mapping instance called FontInfo. Text instances are a bit of work to set up, but give super crisp pixel perfect results.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait DependentNode[Text[M]]
trait SceneNode
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type Out = T

Attributes

Inherited from:
DependentNode

Value members

Concrete methods

def alignCenter: Text[M]
def alignLeft: Text[M]
def alignRight: Text[M]
def enableEvents: Text[M]
def flipHorizontal(isFlipped: Boolean): Text[M]
def flipVertical(isFlipped: Boolean): Text[M]
def modifyMaterial[MB <: Material](alter: M => MB): Text[MB]
def moveBy(pt: Point): Text[M]
def moveBy(x: Int, y: Int): Text[M]
def moveTo(pt: Point): Text[M]
def moveTo(x: Int, y: Int): Text[M]
def onEvent(f: PartialFunction[(Text[_], GlobalEvent), GlobalEvent]): Text[M]
def rotateBy(angle: Radians): Text[M]
def rotateTo(angle: Radians): Text[M]
def scaleBy(amount: Vector2): Text[M]
def scaleBy(x: Double, y: Double): Text[M]
def transformBy(positionDiff: Point, rotationDiff: Radians, scaleDiff: Vector2): Text[M]
def transformTo(newPosition: Point, newRotation: Radians, newScale: Vector2): Text[M]
def withAlignment(newAlignment: TextAlignment): Text[M]
def withDepth(newDepth: Depth): Text[M]
def withEventHandler(f: ((Text[_], GlobalEvent)) => Option[GlobalEvent]): Text[M]
def withFlip(newFlip: Flip): Text[M]
def withFontKey(newFontKey: FontKey): Text[M]
def withLetterSpacing(amount: Int): Text[M]

Sets the horiztonal gap between letters in a line of text. Defaults to 0.

Sets the horiztonal gap between letters in a line of text. Defaults to 0.

Attributes

def withLineHeight(amount: Int): Text[M]

Sets the vertical gap between lines of text in addition (relative to) to the actual height of the text. Defaults to 0.

Sets the vertical gap between lines of text in addition (relative to) to the actual height of the text. Defaults to 0.

Attributes

def withMaterial[MB <: Material](newMaterial: MB): Text[MB]
def withPosition(newPosition: Point): Text[M]
def withRef(newRef: Point): Text[M]
def withRef(x: Int, y: Int): Text[M]
def withRotation(newRotation: Radians): Text[M]
def withScale(newScale: Vector2): Text[M]
def withText(newText: String): Text[M]

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy val x: Int
lazy val y: Int