Objects

This section outlines the functions related to an objects properties.

GameMaker: Studio gives you a number of functions that permit you to get various details about an object. Note, an object is not an instance (an in-game entity), it is purely a resource from which all instances are created. This means that the return values of these functions may be different to the actual values shown by instances in the room, as once an instance is created it can be changed through code and D'n'D actions.

  1. object_exists
  2. object_index
  3. object_get_depth
  4. object_get_mask
  5. object_get_name
  6. object_get_parent
  7. object_get_persistent
  8. object_get_solid
  9. object_get_sprite
  10. object_get_visible
  11. object_get_physics
  12. object_is_ancestor

There are also a number of functions that permit you set the properties for an object. It should be noted that any instances of this object that already exist in the room may not be affected by these functions, but all new instances of this object created in the room will be, so it is recommend that you never change an objects properties when instances of that object are present in the current room.

  1. object_set_depth
  2. object_set_mask
  3. object_set_persistent
  4. object_set_solid
  5. object_set_sprite
  6. object_set_visible

Finally, you can also use certain functions to generate events from code within a specific instance or object. These functions can be very useful, especially when dealing with Parents and Children, and are outlined in the following section:

  1. Generating Events


Back: Objects and Instances
Next: Instances
© Copyright YoYo Games Ltd. 2018 All Rights Reserved