ifCompositor

Implemented by

NameDescription
roCompositorThe roCompositor allows the composition and animation of multiple roBitmaps and roRegions

Supported methods

SetDrawTo(destBitmap as Object, rgbaBackground as Integer) as Void

Description

Sets the destBitmap (roBitmap or roScreen) and the background color.

Parameters

NameTypeDescription
destBitmapObjectThe bitmap to be drawn.
rgbaBackgroundIntegerThe background color to be used.

Draw() as Void

Description

Draws any dirty sprites (that is, whatever is new or has changed since the last Draw). No compositor or sprite operations will be reflected on the display until Draw() is called. After calling Draw(), you must call Finish() (if single buffered) or SwapBuffers() (if double buffered) before the changes will be user visible

DrawAll() as Void

Description

Redraws all sprites even if not dirty. After calling Draw(), you must call Finish() (if single buffered) or SwapBuffers() (if double buffered) before the changes will be user visible

NewSprite(x as Integer, y as Integer, region as Object, z as Integer) as Object

Description

Creates a new sprite, using an roRegion to define the sprite's bitmap. Position the sprite at coordinate x,y. If z is provided, position the sprite in front of all other sprites with equal or lower z value. Sprites with negative z values are not rendered or displayed on the screen.

Parameters

NameTypeDescription
xIntegerThe x-coordinate of the sprite.
yIntegerThe y-coordinate of the sprite.
regionObjectThe region to be used to define the sprite's bitmap.
zIntegerThe z-coordinate of the sprite.

Return Value

Returns an roSprite object.

NewAnimatedSprite(x as Integer, y as Integer, regionArray as Object, z as Integer) as Object

Description

Creates a new sprite that consists of a sequence of frames to be animated. The frames are defined by the regionArray which is an roArray of roRegions. Position the sprite at coordinate x,y. If z is provided, position the sprite in front of all other sprites with equal or lower z value

Parameters

NameTypeDescription
xIntegerThe x-coordinate of the sprite.
yIntegerThe y-coordinate of the sprite.
regionArrayObjectThe frames to be animated.
zIntegerThe z-coordinate of the sprite.

Return Value

Returns an roSprite object.

AnimationTick(duration as Integer) as Void

Description

Moves all animated sprites. Sprites will not animate unless you call this function regularly.

Parameters

NameTypeDescription
durationIntegerThe number of ms since the last call.

ChangeMatchingRegions(oldRegion as Object, newRegion as Object) as Void

Description

Provides a global search and replace of sprite roRegions. Replaces regions that match oldRegion with newRegion

Parameters

NameTypeDescription
oldRegionObjectThe sprite roRegion to be replaced.
newRegionObjectThe new sprite roRegion to be used.