LabelActor API Reference


A LabelActor is derived from an Actor and displays a text game object instead of an image and inherits all properties, functions and so forth from its parent. A LabelActor should be added to a Scene or another Actor once created.

Public properties

  • text – The text to display
  • font – The font to display the text in
  • text_align – Text horizontal alignment
  • text_baseline – Text vertical alignment
  • fill_style – Fill style for filled text
  • stroke_style – Stoke style for none filled text
  • stroke_thickness – Thickness of line stroke
  • filled – When true filled text will be drawn


LabelActor() – Creates an instance of a LabelActor

draw() – Draws an arc actor and its children, this method can be overriden by derived actors

drawToCache() – Draws this actor to a cached canvas, subsequent calls to draw() will cause this cached canvas to be drawn instead

update(dt) – Updates the actor, this method can be overriden by derived actors

  • dt – The amount of time that has passed since this actor was last updated

draw() – Draws the actor, this version is specific to drawing text instead of images (called internally)


Creating a basic label actor


926 total views, 1 views today