Changes the sprite and the sprite properties for a clickable icon.


GML Code Example

clickable_change_ext(index, x, y, tpe, alpha, scale)

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).
scale The scale of the icon (default 1).
alpha The image alpha of the icon (default 1).

Returns: N/A


With this function you can change the sprite and position of a clickable icon previously created with clickable_add. Bear in mind 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). This function also permits you to change the scale of the sprite used (as a multiplier so that 1 is the default, 0.5 would be half and 2 would be double) and the alpha value from 0 (fully transparent) to 1 (fully opaque) for the final icon on the screen.


GML Code Example

switch (room)
    case rm_Menu: clickable_change_ext(global.Help_Icon, 32, 32, sprite_get_tpe(spr_MS_Help, 1), 2, 1); break;
    case rm_Game: clickable_change_ext(global.Help_Icon, 200, 32, sprite_get_tpe(spr_MS_Help, 0), 1, 0.5); 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, changing the icon scale and alpha too.

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