Constant - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Constants refer to "variables" that are accessible everywhere, but whose value cannot change. That is, all constants are read-only. Because of this, a constant isn't technically a variable, but it is included with them for completeness and categorization.
Below is a complete list of constants or pages with lists of constants.
- pi and M_PI = 3.14...; The mathematical pi constant represents the ratio of the circumference of a circle to its diameter, and is used in many trigonometric calculations. The M_PI constant is specific to ENIGMA.
- Boolean constants true (1) and false (0) which indicate that a condition is met or not, respectively.
- Color constants can be used wherever a color is needed, such as arguments to drawing and blending functions. All color constants are prefixed with c_, for example c_blue.
- DLL constants dll_stdcall and dll_cdecl define the type of dll cleanup method, while ty_real and ty_string define the data types.
- Event constants start with ev_, for example ev_alarm.
- Particle constants start with ef_, pt_, and
ps_.
- Effect constants start with ef_, for example ef_cloud.
- Particle type constants start with pt_, and in fact they also all start with pt_shape_, for example pt_shape_circle.
- Particle system constants cover a variety of constants used in various functions. They all start with ps_, for example ps_distr_linear.
- Render state constants used with d3d render mode/state functions
- Audio for the audio system
- Physics for the world of Box2D
Special object-placeholder constants:
- self = -1; Represents this object. Useful for referring to the original object while inside a with construct.
- other = -2; Represents the other object in a collision event.
- all = -3; Represents all objects. Can be used in a with construct to execute code on all active instances in the room. Can also be used in many functions in place of an object argument.
- noone = -4; Represents a null object, or that no object or instance is stored.
- global = -5; Used with dot access to globally access a variable. Also used as a keyword to define such variables so that dot access is not needed.
- local = -7; Used to allow otherwise scoped variables to continue to exist throughout other events of an instance. Otherwise, it is used in Game Maker with dot access to refer to variables local to the current scope (declared with var).
Deprecated constants (see individual pages for deprecation information and replacements):
- Sound effect constants used with sounds start with se_, for example se_reverb.