CWinCtrlMeter¶
Callbacks arriving at :class:`CWindowBase<CWindowBase>`
METER control’s style is set NOHIT flag as default. If you want to receive onDrag callback,you need to set HIT flag to STYLE property.
void onClick(CWinCtrlBase cCtrl)
void onHold(CWinCtrlBase cCtrl)
void onBeginDrag(CWinCtrlBase cCtrl,Vector2 pos)
void onDrag(CWinCtrlBase cCtrl,Vector2 pos,Vector2 dragVelocity)
bool onDragRender(CWinCtrlBase cCtrl,Transform transform)
void onDrop(CWinCtrlBase cCtrl,CWindowBase cDragWindow,CWinCtrlBase cDragCtrl)
-
class CWinCtrlMeter
¶ Functions / Properties
Gets the percentage of the original size that the specified a texture part.
It returns a value in the range of 0 … 1.
By default, this is set to 1 (status of the meter at the max).
-
void
setMeter
(Int32 index, Single value, Single speed = 0.2f)¶ - Param int index
Texture part number
- Param float value
meter’s length(0 … 1)
- Param float speed = 0.2f
animation speed
Changes the size of the specified texture part with animation.
-
void
Example of use
// get control
CWinCtrlMeter mtrLoading = find(METER_Loading) as CWinCtrlMeter;
// Get Meter Position (0 … 1.)
float pos = mtrLoading.meter(3);
// Set 3rd texture part stretch (It can be specified as 0 … 1.)
mtrLoading.setMeter(3,0.5f);