clickable_exists

Checks to see if a clickable DOM icon exists.

Syntax:

GML Code Example

clickable_exists(index);


Argument Description
index The index of the clickable to check.


Returns: Boolean


Description

This function returns whether a clickable DOM icon has been created with the specified index exists or not. Please note, that the value used for checking must have been initialised previously or else you will get an error causing GameMaker: Studio to close.


Example:

GML Code Example

if !clickable_exists(home_but)
    {
    home_but = clickable_add(32, 32, sprite_get_tpe(spr_MS_Home, 0), "http://macsweeney_games.com", "_blank", "width=700, height=500, menubar=0, toolbar=0, scrollbars=0");
    }
 

The above code checks the variable "home_but" to see if it already exists, and if it does not it creates a clickable DOM icon at the position (32, 32) of the page that the game canvas is running on. The icon uses the sprite referenced from the texture page as "spr_MS_Home" and when clicked the icon will open a new window for the specified URL and with the defined properties for that window.


Back: HTML5



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