AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzActorTilemap Class Reference

An actor that connects two points or two actors together like a string. More...

#include <CzActorTilemap.h>

Inheritance diagram for CzActorTilemap:
CzActor IzXomlResource IzAnimTarget

List of all members.

Public Member Functions

bool getProperty (unsigned int property_name, CzXomlProperty &prop)
bool setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta)
 Sets the named property of the ActorTilemap.
bool setProperty (unsigned int property_name, const CzString &data, bool delta)
 Sets the named property of the actor.
 CzActorTilemap ()
bool Update (float dt)
 Updates this actors logic.
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 ()

Protected Member Functions

bool UpdateBinding (unsigned int property_name, CzXomlVariable *var)
 Updates an actor property from the supplied XOML variable.

Static Protected Attributes

static CzXomlClassDefActorTilemapClassDef = NULL

Detailed Description

An actor that connects two points or two actors together like a string.

A Tilemap actor is an image actor that connects either two actors together or an actor to an anchor point. Tilemap actors are useful for creating all sorts of objects such as strings and ropes.

A Tilemap actor is declared using the ActorTilemap XOML tag. The ActorTilemap example has been provided to show how they work. Lets take a quick look at some example XOML:

XOML Example
<ActorTilemap Name="Joiner1" Size="100, 20" Brush="Button1Brush" TargetA="Box1" TargetB="Box2" />

The above XOML creates a Tilemap actor that connects Box1 and Box2 actors together using a visual Tilemap that is 20 units in width and covers 100% of the length of the Tilemap.

In addition to basic actor properties Tilemap actors have a number of new or changed properties, which include:

  • Size (length, width) - Size defines the width of the Tilemap as well as the length as apercentage of the distance between the two end points of the Tilemap. For example, if the length is set to 100% then the actor will stretch from the centre of target A to the centre of target B. If the length is less than 100% then the actor will fall short of the centre points of targets A and B;
  • TargetA (actor) - Defines the actor to fix the start point of the Tilemap actor
  • TargetB (actor) - Defines the actor to fix the end point of the Tilemap actor
  • OffsetA (x, y) - An amount to offset the connection point from Target A. If TargetA actor is not specified then this will be classed as a static scene position
  • OffsetB (x, y) - An amount to offset the connection point from Target B. If TargetB actor is not specified then this will be classed as a static scene position

Constructor & Destructor Documentation


Member Function Documentation

bool CzActorTilemap::getProperty ( unsigned int  property_name,
CzXomlProperty prop 
) [virtual]

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.

Parameters:
property_nameName of the property as a string hash (faster searching).
[in,out]propThe property.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzActor.

void CzActorTilemap::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 CzActor.

int CzActorTilemap::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 CzActorTilemap is derived from CzActor, CzActor::LoadFromXoml() will also be called to load CzActor specific properties.

Parameters:
[in]parentIf non-null, the parent.
load_childrentrue to load child nodes.
[in]nodeIf non-null, the XOML markup node that defines this object
Returns:
negative value for error. if 0 then processing of further XOML will stop.

Reimplemented from CzActor.

void CzActorTilemap::ReleaseClass ( ) [static]

Reimplemented from CzActor.

bool CzActorTilemap::setProperty ( unsigned int  property_name,
const CzXomlProperty data,
bool  delta 
) [virtual]

Sets the named property of the ActorTilemap.

Sets the named property of this ActorTilemap. 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.

Parameters:
property_nameName of the property as a string hash (faster searching).
[in]dataThe property data.
deltatrue if property should be added to instead of replaced.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzActor.

bool CzActorTilemap::setProperty ( unsigned int  property_name,
const CzString data,
bool  delta 
) [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 CzActorTilemap is derived from CzActor, all CzActor properties will also be checked against.

Parameters:
property_nameName of the property as a string hash (faster searching).
[in]dataThe property data.
deltatrue to property should be added to instead of replaced.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzActor.

bool CzActorTilemap::Update ( float  dt) [virtual]

Updates this actors logic.

Updates the actors logic, including calculating end points of the Tilemap and the scale to fit to the specified size. In addition CzActor::Update() is called to perform the base actor update.

Parameters:
dtThe number of seconds since the app was last updated
Returns:
true if it succeeds, false if it fails.

Reimplemented from CzActor.

bool CzActorTilemap::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.

Parameters:
property_nameName of the property.
[in,out]varIf non-null, the variable.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzActor.

bool CzActorTilemap::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.

Parameters:
[in]animationIf non-null, the animation.
Returns:
true if it succeeds, false if property does not exist.

Reimplemented from CzActor.


Member Data Documentation


The documentation for this class was generated from the following files: