gs.ThreePartImage Class
A three-part image is rendered using three
sub-images: start, middle and end. The start and end will be rendered
with fixed size while the middle-part will be stretched in a way like this:
|Start-Part Fixed|<-----------Middle-Part Stretched----------->|End-Part Fixed
A three-part image is automatically added to the graphics-system
and rendered every frame until it gets disposed. It can be horizontal or
vertical.
Constructor
gs.ThreePartImage
()
Item Index
Methods
Methods
dispose
()
Disposes the three-part image and frees resources. After that the image is no longer rendered. The associated skin-bitmap is not disposed.
draw
()
Draws the three-part image. Shouldn't be called manually.
initialize
()
protected
Initializes the graphic object.
update
()
Updates the three-part image.
Properties
anchor
gs.Point
The anchor point. For example: An anchor-point with 0,0 rotates the object around its top-left corner but with an 0.5, 0.5 anchor-point the object rotates around its center. An anchor-point of 1,1 rotates the object around its lower-right corner. It has not effect on the object's positioning. For positioning, take a look at positionAnchor property.
color
Boolean
The color. Can be used for flashing-effects, etc.
disposed
Boolean
Indicates if the object is disposed. A disposed object is not rendered.
effects
gs.EffectCollection
The effect settings for different kind of visual effect like wobble, etc.
firstPartSize
Number
The size of the start-part. Default is 16px.
height
Number
The height of the three-part image. The middle-part will stretched if orientation is vertical.
id
Number
The unique identifier of the graphic object.
index
Number
The current index in the global rendering list. This property is read-only and automatically calculated at runtime depending on z-property.
lastPartSize
Number
The size of the last-part. Default is 16px.
middlePartSize
Number
The size of the middle-part. Default is 1px.
onIndexChange
Function
Fired if the graphic object's current index in the global rendering list was changed.
Default: null
opacity
Number
The opacity goes from 0 to 255. For example: A value of 0 means fully transparent, 255 means fully opaque and 128 means semi-transparent.
orientation
gs.Orientation
The orientation. Default is gs.Orientation.VERTICAL.
ox
Number
The x-coordinate of the origin.
oy
Number
The y-coordinate of the origin.
positionAnchor
gs.Point
The position anchor point. For example: An anchor-point with 0,0 places the object with its top-left corner at its position but with an 0.5, 0.5 anchor-point the object will be placed with its center. An anchor-point of 1,1 will place the object with its lower-right corner. It has not effect on the object's rotation/zoom anchor. For that, take a look at anchor property.
srcRect
gs.Rect
The source-rectangle. Only that area of the skin is used to construct the three-part image.
transform
Mat2d
The transformation matrix of the graphic object.
visible
Boolean
Indicates if the object is rendered.
width
Number
The width of the three-part image. The middle-part will stretched if orientation is horizontal.
x
Number
The x-coordinate of the position.
y
Number
The y-coordinate of the position.
z
Number
The z-index controls rendering-order/image-overlapping. An object with a smaller z-index is rendered before an object with a larger index. For example: To make sure a graphic object is always on top of the screen, it should have the largest z-index of all graphic objects.