Implemented By
Supported Methods
- GetBitmap() as Object
- GetX() as Integer
- GetY() as Integer
- GetWidth() as Integer
- GetHeight() as Integer
- Offset(x as Integer, y as Integer, w as Integer, h as Integer) as Void
- Set(srcRegion as Object) as Void
- Copy() as Object
- SetWrap(wrap as Boolean) as Void
- GetWrap() as Boolean
- SetTime(time as Integer) as Void
- GetTime() as Integer
- SetPretranslation(x as Integer, y as Integer) as Void
- GetPretranslationX() as Integer
- GetPretranslationY() as Integer
- SetScaleMode(mode as Integer) as Void
- GetScaleMode() as Integer
- SetCollisionType(collisiontype as Integer) as Void
- GetCollisionType() as Integer
- SetCollisionRectangle(xOffset as Integer, yOffset as Integer, width as Integer, height as Integer) as Void
- SetCollisionCircle(xOffset as Integer, yOffset as Integer, Radius as Integer) as Void
Description of Methods
GetBitmap() as Object
Returns the roBitmap object of the bitmap this region refers to. A region is always a section of a bitmap.
GetX() as Integer
Returns the x coordinate of the region in its bitmap.
GetY() as Integer
Returns the y coordinate of the region in its bitmap.
GetWidth() as Integer
Returns the width of the region.
GetHeight() as Integer
Returns the height of the region.
Offset(x as Integer, y as Integer, w as Integer, h as Integer) as Void
Adds the passed parameters x,y, w, and h to the values of those roRegion fields
Respects the wrap setting when adjusting the fields by the offsets.
Set(srcRegion as Object) as Void
Takes an roRegion object as input
Initializes the fields of this region to be the same as the values of the fields in the srcRegion.
Copy() as Object
Returns a newly created copy of the region as a new roRegion object.
SetWrap(wrap as Boolean) as Void
If wrap is true, any part of a region that extends beyond the bounds of its bitmap "wraps" to the other side of the bitmap and is rendered there. If wrap is false, the part of the region beyond the bounds of its bitmap is not rendered.
GetWrap() as Boolean
Returns true if the region will wrap.
SetTime(time as Integer) as Void
Set the "frame hold time" in milliseconds. This is the duration of each frame of any animated sprite which uses this region.
GetTime() as Integer
Returns the "frame hold time" in milliseconds.
SetPretranslation(x as Integer, y as Integer) as Void
Set the pretranslation for DrawObject, DrawRotatedObject, and DrawScaledObject.
GetPretranslationX() as Integer
Returns the pretranslation x value.
GetPretranslationY() as Integer
Returns the pretranslation y value.
SetScaleMode(mode as Integer) as Void
Set the scaling mode used for DrawScaledObject
- 0 = fast scaling operation (may have jaggies)
- 1 = smooth scaling operation (may be slow)
GetScaleMode() as Integer
Returns the scaling mode.
SetCollisionType(collisiontype as Integer) as Void
Sets the type of region to be used for collision tests with this sprite.
- Type 0– Use the entire defined region of the sprite. Type 0 is the default.
- Type 1 – Use the defined rectangular region specified by the SetCollisionRectangle() method.
- Type 2 – Use a circular region specified by the SetCollisionCircle() method.
GetCollisionType() as Integer
Returns the collision type.
SetCollisionRectangle(xOffset as Integer, yOffset as Integer, width as Integer, height as Integer) as Void
Sets the collision rectangle used for type 1 collision tests. The upper left corner of the rectangle is the (x,y) position of the sprite plus the specified offsets. width and height specify the size of the rectangle.
SetCollisionCircle(xOffset as Integer, yOffset as Integer, Radius as Integer) as Void
Sets the collision circle used for type 2 collision tests. The center of the circle is the (x,y) position of the sprite plus the specified offsets. radius specifies the size of the circle.