clickable_change

Changes the sprite used for a clickable icon.

Syntax:

GML Code Example

clickable_change(index, x, y, tpe)


Argument Description
index The index of the clickable icon to change.
x The new x position within the window.
y The new y position within the window.
tpe The texture page entry for the sprite to be used (use sprite_get_tpe).


Returns: N/A


Description

With this function you can change the sprite and position of a clickable icon previously created with clickable_add. Please note that the position is based on the window, not the canvas, (0,0) position and that the sprite must be referenced directly from the texture page (see: sprite_get_tpe).


Example:

GML Code Example

switch (room)
    {
    case rm_Menu: clickable_change(global.Help_Icon, 32, 32, sprite_get_tpe(spr_MS_Help, 1)); break;
    case rm_Game: clickable_change(global.Help_Icon, 200, 32, sprite_get_tpe(spr_MS_Help, 0)); break;
    }
 

The above code will change the image index and position of the clickable icon indexed in the variable "global.Help" depending on the current room.





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