Simple class for fading Widgets.
More...
Simple class for fading Widgets.
Timer class. Use when you want call function after some time, or repeatedly in time intervals. Call is not executed after the Timer object is deleted.
usage:
Definition at line 405 of file tools.c.
◆ FadeIn()
Make "fade in" effect on Widget (transparency goes from 0.0 to 1.0)
- Parameters
-
w | widget which will be faded |
time | duration of effect |
continue | - if True continue from current alpha value, otherwise always begin from 0.0 alpha |
Definition at line 423 of file tools.c.
424 {
426
428 {
431 return;
432 }
433
436
438
440 {
444 }
445
448 }
References m_time, and OnStart().
◆ FadeOut()
Make "fade out" effect on Widget (transparency goes from 1.0 to 0.0)
- Parameters
-
w | widget which will be faded |
time | duration of effect |
continue | - if True continue from current alpha value, otherwise always begin from 1.0 alpha |
Definition at line 456 of file tools.c.
457 {
459
461 {
464 return;
465 }
466
469
471
473 {
477 }
478
481 }
References m_alpha, m_time, and OnStart().
◆ OnTimer() [1/2]
void TimerBase::OnTimer |
( |
| ) |
|
|
inlineprivate |
Definition at line 483 of file tools.c.
484 {
486 {
489 else
490 {
493 }
494 }
495 }
Referenced by Tick().
◆ OnTimer() [2/2]
void TimerBase::OnTimer |
( |
| ) |
|
|
inlineprotected |
Definition at line 574 of file tools.c.
575 {
577 {
580 }
581 else
583 }
proto native CGame GetGame()
References GetGame().
◆ OnUpdate()
void TimerBase::OnUpdate |
( |
| ) |
|
|
inlineprivate |
Definition at line 497 of file tools.c.
498 {
502 {
505 else
506 {
509 }
510
512 }
513 }
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
References Math::Clamp(), Math::Lerp(), m_duration, and m_time.
Referenced by Tick().
◆ Run()
Starts timer.
- Parameters
-
duration | function is executed after this time (in seconds). |
obj | target object on which function will be executed |
fn_name | name of function (on object "obj") which will be executed |
params | function arguments see Param for usage, default NULL (no arguments) |
loop | when true, timer is looped endlessly and function is executed after every loop. |
Definition at line 565 of file tools.c.
References OnStart().
◆ Stop()
◆ Timer()
◆ WidgetFadeTimer()
void TimerBase::WidgetFadeTimer |
( |
| ) |
|
|
inlineprivate |
◆ m_alpha
◆ m_fadeIn
◆ m_function
◆ m_params
◆ m_target
◆ m_widget
The documentation for this class was generated from the following file: