Object_Visual Class
The base class for all regular visual game objects.
Constructor
Object_Visual
()
Item Index
Methods
Methods
restore
-
data
Restores the game object from a data-bundle.
Parameters:
-
data
Object- The data-bundle.
Properties
anchor
gs.Point
The object's 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 is placed with its center. An anchor-point of 1,1 places the object with its lower-right corner.
blendMode
Number
The object's blend mode controls how the blending of the object's visual representation is calculated.
Default: gs.BlendMode.NORMAL
dstRect
gs.Rect
The object's destination rectangle on screen.
effects
gs.EffectCollection
Contains different kinds of shader effects which can be activated for the object.
motionBlur
gs.MotionBlur
The object's motion-blur settings.
offset
gs.Point
The object's offset.
opacity
Number
The object's opacity to control transparency. For example: 0 = Transparent, 255 = Opaque, 128 = Semi-Transparent.
origin
gs.Point
The object's 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.
viewport
gs.Viewport
The object's viewport.
visible
Boolean
Indiciates if the game object is visible on screen.
zIndex
Number
The object's 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 game object is always on top of the screen, it should have the largest z-index of all game objects.
zoom
gs.Point
The object's zoom-setting for x and y axis. The default value is { x: 1.0, y: 1.0 }