GMRoundButton is an easy to use customisable button with a visual feedback.
On press, its color switches from a second state back to its default state within a defined period of time.
It only responds to mouse down clicks, and does not discriminate button identifiers.
.frameRate
method inherited from the UserView class is unreliable, the frame rate of this UserView is hardcoded at 60 fps, and changing it will desynchronize the blinkTime
value.Creates a new instance of GMRoundButton.
Its graphical properties are defined by its associated GMStyle.
Both the blink color and the font blink color must be set explicitly.
a GMRoundButton instance.
Sets or gets the Function to be triggered when the button is pressed down. Doesn't take argument.
aFunction |
A Function without argument. |
Sets or gets the Function to be triggered when the button is pressed down. Doesn't take argument. Equivalent to .action
.
aFunction |
A Function without argument. |
Triggers the button animation, without evaluating associated function. This method allows to simulate the button being pressed using code. Refresh call is internally deferred, so this method can be called safely within a Routine context.
Sets or gets the widget back color when it's starting its visual effect.
Sets or gets the widget font color when it's starting its visual effect.
Sets or gets the time in seconds it takes for the View's to complete its visual effect.
aNumber |
A Float value, in seconds. |
Sets or gets the button displayed text, and refreshes the View.
Sets or gets the widget displayed text ratio, relative to the size of the widget (not counting the border size). You'll need to reduce this value if the displayed text is larger than the size of the widget.
Deprecated, use fontRatio instead.
Sets or gets the displayed text max height, in pixels.
Sets or gets the button displayed text orientation. Valid values are : \right
, \top
, \left
or \bottom
. This doesn't affect the displayed svg if any.
Sets or gets the button displayed svg, and refreshes the View. Takes a String indicating the path to the svg file as argument.
Sets or gets the widget displayed svg ratio, relative to the smallest axis of the widget, and refreshes the View.
Removes the svg and frees its ressources. Refreshes the View.
The function associated to the View's drawFunc
. Shouldn't be modified.
The function that rescales the svg when needed.