Pushes a given value (or values) onto the top of the stack.


GML Code Example

ds_stack_push(id, val [, val2, ... val15]);

Argument Description
id The id of the data structure to push onto.
val The value to push onto the stack.
[val2, ... val13] Optional values to be added to the stack.

Returns: N/A


This function will push (add) a value, which can be either a real or a string, onto the top of the stack. The function can take a further 14 optional arguments (making a total of 15 possible additions), permitting you to push multiple values consecutively to the stack in a single call.


GML Code Example

move_stack = ds_stack_create();
 ds_stack_push(move_stack, x, y, x, y + 200, x + 200, y + 200, x +200, y);

The above code creates a new ds_stack and stores its index in the variable "move_stack". It then pushes a number of values onto the stack for future use.

Back: Stacks

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here