Clickables - Grisgram/gml-raptor GitHub Wiki

You are here:

Base Controls - Containers - Tooltips - ✔Clickables - Checkables - ListBox - InputBox - Mouse Cursor - ControlTree


Clickable Controls

All controls that can be clicked (the Buttons, the InputBox and all Checkables) add some more variables to the pool:

image

on_left_click
on_middle_click
on_right_click
on_double_click
A callback to be invoked when the event occurs.
NOTE: You must enter the function name without braces! See example at the bottom of this page
on_enter_sound
on_leave_sound
on_click_sound
Pick or enter the name of a sound asset here to have it played when the event occurs
hotkey_left_click
hotkey_middle_click
hotkey_right_click
Enter the string representation of a hotkey here, that shall trigger the event.
Examples: vk_enter, vk_escape, A, F5. See GameMaker Keyboard Input
hotkey_only_when_topmost If true, the hotkey only works, if this control is not hidden in any way. See GUI_EVENTs at Utility and Helper #macros

TextButton and ImageButton

The two button controls add these variable definitions:

image

Plus, the ImageButton adds one more:

image

image_index_default
image_index_mouse_over
image_index_mouse_down
The first image is the neutral image, the second is a bit brighter, when the mouse is over and the third one is a bit smaller, so it looks as if it were pressed down.
See here the default button sprite with 3 frames:
sprDefaultButton_strip3
sprite_to_use This is the sprite that will be rendered at the button's surface

The Slider Control

This control offers a user-friendly way to enter a value by dragging a knob along a rail to change a value between a set min and max value.

It brings quite a lot new variable definitions on board:

image

value
min_value
max_value
The actual value, and the min-max range of values (both including)
on_value_changed
on_mouse_enter_knob
on_mouse_leave_knob
Callbacks, when the value changes or the mouse touches the knob
rail_sprite
knob_sprite
Sprites to use for the graphical elements of the Slider
knob_xscale
knob_yscale
image_scale of the knob sprite in x and y
auto_text What text shall be auto-generated on the Slider. Values are text_is_value, text_is_percent or none
auto_text_position Depending on orientation_horizontal, you choose whether the text shall be rendered above or below (horizontal) or to the left or right (vertical) of the slider rail
orientation_horizontal Choose, whether you want a horizontal or vertical slider orientation.
Horizontal means, value goes up from left-to-right and
Vertical means, value goes up from bottom-to-top

How to enter a callback function correct

Enter the name of a function without braces here (it's an expression!) to have the callback invoked in the respective click event.

Right Wrong
image image

You are here:

Base Controls - Containers - Tooltips - ✔Clickables - Checkables - ListBox - InputBox - Mouse Cursor - ControlTree

⚠️ **GitHub.com Fallback** ⚠️