DayZ Enforce
Script API
Private Member Functions | Private Attributes | List of all members
AnimatorTimer Class Reference

AnimatorTimer class. This timer is for animate float value.
usage: More...

#include <tools.h>

Inheritance diagram for AnimatorTimer:

Private Member Functions

void  AnimatorTimer (class target, string callback_fn_name, int category=CALL_CATEGORY_GUI)
 
void  Animate (float val, float speed=1.0)
  Starts animate value until value reaches target value. More...
 
void  AnimateLoop (float speed=1.0)
  Starts infinite animation loop <-1,1>. Based on sinus transition. More...
 
float  GetValue ()
  Returns actual animated value. More...
 
float  GetTargetValue ()
  Returns target value. While AnimateLoop returns angle of cycle in radians. More...
 
void  SetValue (float val)
  Sets both value and target value. More...
 
void  Tick (float timeslice)
  Ticks the timer, is called by timer subsystem. More...
 

Private Attributes

private string  m_function
 
private float  m_target_value
 
private float  m_value
 

Detailed Description

AnimatorTimer class. This timer is for animate float value.
usage:

class MyObject
{
autoptr AnimatorTimer myAnim;
void MyObject()
{
myAnim = new AnimatorTimer(this, "Refresh", CALL_CATEGORY_GUI);
myAnim.SetValue(6.0);
myAnim.Animate(10.0, 0.1);
}
void Refresh()
{
Print(myAnim.GetValue());
}
};

Constructor & Destructor Documentation

void AnimatorTimer::AnimatorTimer ( class target  ,
string  callback_fn_name,
int  category = CALL_CATEGORY_GUI 
)
private

Member Function Documentation

void AnimatorTimer::Animate ( float  val,
float  speed = 1.0 
)
private

Starts animate value until value reaches target value.

Parameters
val float target value
speed float speed of animating, units per second

References m_loop, m_target_value, m_time, and SetRunning().

Referenced by HoverEffect::OnMouseEnter(), and HoverEffect::OnMouseLeave().

void AnimatorTimer::AnimateLoop ( float  speed = 1.0 )
private

Starts infinite animation loop <-1,1>. Based on sinus transition.

Parameters
speed float speed of animating , cycles per second (1.0 means one 360 degree sinus cycle per second: 0..1..0..-1..0)

References m_loop, m_target_value, m_time, m_value, and SetRunning().

Referenced by Rotator::OnWidgetScriptInit(), and Bouncer::OnWidgetScriptInit().

float AnimatorTimer::GetValue ( )
private

Returns actual animated value.

References m_value.

Referenced by Bouncer::Update(), and HoverEffect::Update().

float AnimatorTimer::GetTargetValue ( )
private

Returns target value. While AnimateLoop returns angle of cycle in radians.

References m_target_value.

Referenced by Rotator::Update().

void AnimatorTimer::SetValue ( float  val )
private

Sets both value and target value.

void AnimatorTimer::Tick ( float  timeslice )
private

Member Data Documentation

private string AnimatorTimer::m_function
private

Referenced by AnimatorTimer(), and Tick().

private float AnimatorTimer::m_target_value
private
private float AnimatorTimer::m_value
private

The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)