AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
#include <CzUIImageView.h>
Public Member Functions | |
CzUIIcon * | getIcon () |
void | setArea (CzIVec2 &size) |
CzIVec2 | getArea () const |
void | setZoom (float scale) |
float | getZoom () const |
void | setMinZoom (float scale) |
float | getMinZoom () const |
void | setMaxZoom (float scale) |
float | getMaxZoom () const |
CzUIImageView () | |
virtual bool | InitView (IzBrush *brush, int width, int height, bool native_res, float min_scale, float max_scale) |
bool | Update (float dt) |
Updates this actors logic. | |
bool | UpdateVisual () |
Updates the actors visual. | |
void | NotifyBeginTouch (int index, int x, int y, bool allow_bubble) |
OnBeginTouch event handler. | |
void | NotifyEndTouch (int index, int x, int y, bool allow_bubble) |
OnEndTouch event handler. | |
int | LoadFromXoml (IzXomlResource *parent, bool load_children, CzXmlNode *node) |
Creates an instance of this class from XML. | |
bool | UpdateFromAnimation (CzAnimInstance *animation) |
Updates actor property from supplied animation. | |
Static Public Member Functions | |
static void | InitClass () |
Initialises the class. | |
static void | ReleaseClass () |
static bool | _setMinZoom (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getMinZoom (IzXomlResource *target) |
static bool | _setMaxZoom (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getMaxZoom (IzXomlResource *target) |
static bool | _setZoom (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getZoom (IzXomlResource *target) |
static bool | _setImageBrush (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getImageBrush (IzXomlResource *target) |
static bool | _setArea (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getArea (IzXomlResource *target) |
Protected Member Functions | |
bool | setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta) |
Sets the named property of the UIImageView. | |
bool | setProperty (unsigned int property_name, const CzString &data, bool delta) |
Sets the named property of the actor. | |
bool | getProperty (unsigned int property_name, CzXomlProperty &prop) |
Gets the named property of the actor. | |
bool | UpdateBinding (unsigned int property_name, CzXomlVariable *var) |
Updates an actor property from the supplied XOML variable. | |
Protected Attributes | |
CzUIIcon * | Icon |
The ico0n that is used to display the image. | |
CzIVec2 | Area |
The area that the image should fit into. | |
float | Zoom |
Current zoom. | |
float | MinZoom |
The minimum zoom point. | |
float | MaxZoom |
The maximum zoom point. | |
float | PrevZoom |
CzVec2 | Midpoint |
bool | ZoomValid |
float | PreviousDist |
float | CompoundScale |
CzVec2 | CompoundPosition |
float | SavedCompoundScale |
CzVec2 | SavedCompoundPosition |
CzVec2 | PanVelocity |
int | TouchIndices [2] |
int | NumTouches |
Static Protected Attributes | |
static CzXomlClassDef * | ImageViewClassDef = NULL |
CzXomlProperty CzUIImageView::_getArea | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIImageView::_getImageBrush | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIImageView::_getMaxZoom | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIImageView::_getMinZoom | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzUIImageView::_getZoom | ( | IzXomlResource * | target | ) | [static] |
bool CzUIImageView::_setArea | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIImageView::_setImageBrush | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIImageView::_setMaxZoom | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIImageView::_setMinZoom | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzUIImageView::_setZoom | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
CzIVec2 CzUIImageView::getArea | ( | ) | const [inline] |
CzUIIcon* CzUIImageView::getIcon | ( | ) | [inline] |
float CzUIImageView::getMaxZoom | ( | ) | const [inline] |
float CzUIImageView::getMinZoom | ( | ) | const [inline] |
bool CzUIImageView::getProperty | ( | unsigned int | property_name, |
CzXomlProperty & | prop | ||
) | [protected, virtual] |
Gets the named property of the actor.
Returns the named property of the actor. The properties value is returned in a CzXomlProperty which is a structure that contains a union of all possible property types. Note that as CzUIImageView is derived from CzUIBase, all CzUIBase properties will also be checked against.
property_name | Name of the property. | |
[out] | prop | The property data that. |
Reimplemented from CzUIBase.
float CzUIImageView::getZoom | ( | ) | const [inline] |
void CzUIImageView::InitClass | ( | ) | [static] |
Initialises the class.
Sets up the classes avaiiable properties. Used by the XOML system to find, set amd get class properties.
Reimplemented from CzUIBase.
bool CzUIImageView::InitView | ( | IzBrush * | brush, |
int | width, | ||
int | height, | ||
bool | native_res, | ||
float | min_scale, | ||
float | max_scale | ||
) | [virtual] |
int CzUIImageView::LoadFromXoml | ( | IzXomlResource * | parent, |
bool | load_children, | ||
CzXmlNode * | node | ||
) | [virtual] |
Creates an instance of this class from XML.
LoadFromXoml is the main method used by all classes that can be instantiated from XOML mark-up. This method creates an instance of this class from the supplied XML node structure specified by node. if parent is not NULL then the created instance will utilise the supplied parent to determine where it should live within the app. For example, if the parent is a scene then the actor will be placed in that scene. if the parent is another actor then this actor will be placed into the scene of the supplied actor and linked as a child to the parent actor. If load_chlldren is true then any child nodes contained within the actor will also be loaded. Note that as CzUIImageView is derived from CzUIBase, CzUIBase::LoadFromXoml() will also be called to load CzUIBase specific properties.
[in] | parent | If non-null, the parent. |
load_children | true to load child nodes. | |
[in] | node | If non-null, the XOML markup node that defines this object |
Reimplemented from CzUIBase.
void CzUIImageView::NotifyBeginTouch | ( | int | index, |
int | x, | ||
int | y, | ||
bool | allow_bubble | ||
) | [virtual] |
OnBeginTouch event handler.
The OnBeginTouch event handler is called whenever the user begins to touch the actor. Actors can process up to 5 simultaneous touch events OnBeginTouch to OnBeginTouch5. if event bubbling is enabled then the event will also be passed up to the parent.
This version of this method enables actors to utilise a selected state
index | Index of the touch. |
x | The touched x coordinate. |
y | The touched y coordinate. |
allow_bubble | true to allow event bubbling, false to deny event bubbling. |
Reimplemented from CzUIBase.
void CzUIImageView::NotifyEndTouch | ( | int | index, |
int | x, | ||
int | y, | ||
bool | allow_bubble | ||
) | [virtual] |
OnEndTouch event handler.
The OnEndTouch event handler is called whenever the user stops touching the actor. This can occur for a number fo reasons including:
Actors can process up to 5 simultaneous touch events OnEndTouch to OnEndTouch5. if event bubbling is enabled then the event will also be passed up to the parent.
This version of this method enables actors to utilise a selected state
index | Index of the touch. |
x | The touched x coordinate. |
y | The touched y coordinate. |
allow_bubble | true to allow event bubbling, false to deny event bubbling. |
Reimplemented from CzUIBase.
void CzUIImageView::ReleaseClass | ( | ) | [static] |
Reimplemented from CzUIBase.
void CzUIImageView::setArea | ( | CzIVec2 & | size | ) |
void CzUIImageView::setMaxZoom | ( | float | scale | ) | [inline] |
void CzUIImageView::setMinZoom | ( | float | scale | ) | [inline] |
bool CzUIImageView::setProperty | ( | unsigned int | property_name, |
const CzXomlProperty & | data, | ||
bool | delta | ||
) | [protected, virtual] |
Sets the named property of the UIImageView.
Sets the named property of this UIImageView. The properties value supplied will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced.
property_name | Name of the property as a string hash (faster searching). | |
[in] | data | The property data. |
delta | true if property should be added to instead of replaced. |
Reimplemented from CzUIBase.
bool CzUIImageView::setProperty | ( | unsigned int | property_name, |
const CzString & | data, | ||
bool | delta | ||
) | [protected, virtual] |
Sets the named property of the actor.
Sets the named property of this actor. The properties value (data) is supplied as a string and will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced. Note that as CzUIImageView is derived from CzUIBase, all CzUIBase properties will also be checked against.
property_name | Name of the property as a string hash (faster searching). | |
[in] | data | The property data. |
delta | true to property should be added to instead of replaced. |
Reimplemented from CzUIBase.
void CzUIImageView::setZoom | ( | float | scale | ) |
bool CzUIImageView::Update | ( | float | dt | ) | [virtual] |
Updates this actors logic.
Updates the UI actors logic, including:
This method should be overriden by derived actors to provide the UI actor specific logic.
Note that dt is used to scale actor internals that rely on time. This value enables the actor run in an environment where time (the frame rate of the device) can vary allowing animation to keep up without slowing down or speeding up when the frame rate varies.
Note that if an actor returns false then it will automatically be removed from the scene.
dt | The number of seconds since the app was last updated |
Reimplemented from CzUIBase.
bool CzUIImageView::UpdateBinding | ( | unsigned int | property_name, |
CzXomlVariable * | var | ||
) | [protected, virtual] |
Updates an actor property from the supplied XOML variable.
Updates a single property from the value of the bound XOML variable. Note that as CzUIImageView is derived from CzUIBase, all CzUIBase properties will also be checked against.
property_name | Name of the property. | |
[in,out] | var | If non-null, the variable. |
Reimplemented from CzUIBase.
bool CzUIImageView::UpdateFromAnimation | ( | CzAnimInstance * | animation | ) | [virtual] |
Updates actor property from supplied animation.
Updates the actors property that is specified by the supplied animation. When a timeline animation targets the property of an actor this method will be called by the animation to move the animations frame data into its target property. Note that as CzUIImageView is derived from CzUIBase, all CzUIBase properties will also be checked against.
[in] | animation | If non-null, the animation. |
Reimplemented from CzUIBase.
bool CzUIImageView::UpdateVisual | ( | ) | [virtual] |
Updates the actors visual.
Transfers visual data from the actor to the visual such as position, angle, scale, colour etc..
Reimplemented from CzActorImage.
CzIVec2 CzUIImageView::Area [protected] |
The area that the image should fit into.
CzVec2 CzUIImageView::CompoundPosition [protected] |
float CzUIImageView::CompoundScale [protected] |
CzUIIcon* CzUIImageView::Icon [protected] |
The ico0n that is used to display the image.
CzXomlClassDef * CzUIImageView::ImageViewClassDef = NULL [static, protected] |
float CzUIImageView::MaxZoom [protected] |
The maximum zoom point.
CzVec2 CzUIImageView::Midpoint [protected] |
float CzUIImageView::MinZoom [protected] |
The minimum zoom point.
int CzUIImageView::NumTouches [protected] |
CzVec2 CzUIImageView::PanVelocity [protected] |
float CzUIImageView::PreviousDist [protected] |
float CzUIImageView::PrevZoom [protected] |
CzVec2 CzUIImageView::SavedCompoundPosition [protected] |
float CzUIImageView::SavedCompoundScale [protected] |
int CzUIImageView::TouchIndices[2] [protected] |
float CzUIImageView::Zoom [protected] |
Current zoom.
bool CzUIImageView::ZoomValid [protected] |