API Docs for:
Show:

Object_Visual Class

Extends gs.Object_Base
Module: gs

The base class for all regular visual game objects.

Constructor

Object_Visual

()

Methods

restore

(
  • data
)

Provided by the module.

Restores the game object from a data-bundle.

Parameters:

  • data Object
    • The data-bundle.

Properties

anchor

gs.Point

Provided by the module.

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

Provided by the module.

The object's blend mode controls how the blending of the object's visual representation is calculated.

Default: gs.BlendMode.NORMAL

dstRect

gs.Rect

Provided by the module.

The object's destination rectangle on screen.

effects

gs.EffectCollection

Provided by the module.

Contains different kinds of shader effects which can be activated for the object.

motionBlur

gs.MotionBlur

Provided by the module.

The object's motion-blur settings.

offset

gs.Point

Provided by the module.

The object's offset.

opacity

Number

Provided by the module.

The object's opacity to control transparency. For example: 0 = Transparent, 255 = Opaque, 128 = Semi-Transparent.

origin

gs.Point

Provided by the module.

The object's origin.

positionAnchor

gs.Point

Provided by the module.

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

Provided by the module.

The object's viewport.

visible

Boolean

Provided by the module.

Indiciates if the game object is visible on screen.

zIndex

Number

Provided by the module.

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

Provided by the module.

The object's zoom-setting for x and y axis. The default value is { x: 1.0, y: 1.0 }