RectActor API Reference


b5.RectActor

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

Public properties

  • fill_style – Style used to fill the rect
  • stroke_style – Stroke used to draw none filled rect
  • stroke_thickness – Thickness of line stroke
  • filled – if true then rect interior will filled otherwise empty
  • corner_radius – Radius of corner for rounded rects

Methods

RectActor() – Creates an instance of a RectActor object

draw() – Draws a rect 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

Examples

Example showing how to create a rect actor

 

606 total views, 1 views today