Global_local - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Global locals refer to variables that every object has, but can store different values per object.
Below is an incomplete list of global locals already defined by ENIGMA and GM:
- x - the object's x (horizontal) coordinate in the room. 0 is the leftmost part of the room, with positive numbers going to the right.
- y - the object's y (vertical) coordinate in the room. 0 is the topmost part of the room, with positive numbers going down (in this sense, the y axis is flipped from what we would normally expect).
- id[1] - a unique identifier for this instance.
- sprite_index - the sprite currently assigned to this object.
- mask_index - the collision mask currently assigned to this object.
- image_index - the current animation subimage, where 0 is the first subimage.
- image_speed - the animation speed, in subimages per step. 0 indicates no animation. Values between 0.0 and 1.0 will animate slowly, causing some subimages to display for multiple steps. 1 indicates normal animation (1 subimage per step). Values greater than 1 will animate quickly, causing some subimages to be skipped.
- image_number[2] - how many subimages the current sprite has.
- image_single (deprecated) - Combination of image_index and image_speed, where -1 indicates normal animation, and >= 0 indicates that image_speed should be 0 (no animation) and image_index should be the value. Since this variable is deprecated, use of it can lead to unpredictable results.
- image_xscale - horizontal scale factor of the sprite. 1.0 indicates normal size, 0.5 indicates half size, 2.0 indicates double size, -1.0 horizontally flips the image.
- image_yscale - vertical scale factor of the sprite.
- image_angle - Angle to rotate the sprite, counter-clockwise, in degrees. 0 indicates no rotation.
- image_blend - Blending color of the sprite. Black creates a silhouette, white preserves the original image.
- image_alpha - Alpha transparency of the sprite. Values between 0.0 (fully transparent) and 1.0 (fully opaque).
[3]
- Read-only variables. The value may change or vary, but objects and instances cannot directly alter their value.