


The idea this week is to get those sprites animating (aside from rotating, scaling and moving), we want the image of our sprite to change. We began to create a basic API called IwGame which will eventually serve as our game engine framework that we can all hopefully build cool games around (that is once we have weeded all of my bugs out ).

In the last tutorial we covered basic sprites and more to the point bitmapped sprites. At least the news of our game BattleBallz Chaos being shown at the Blackberry Devcon 2011 lifted the old spirits. Had flu all week and now I’ve been afflicted with a chest infection so it’s been a pretty miserable week. This tutorial is part of the Marmalade SDK tutorials collection. Create a set of XML attributes that will replace the template parametersĬIwGameXmlNode* replacements = new CIwGameXmlNode() Īndroid App Development, AppEasy, Blackberry Playbook App Development, C++ Programming, Game and App Development, iOS App Development, IwGame Engine, Samsung Bada Development AppEasy, IwGame, markup, parameters, Template, Tutorial, XOML 2 Comments To instantiate a template from C++, we firstly need to find the template, build the parameters then instantiate the template passing in the parameters:ĬIwGameTemplate* temp = (CIwGameTemplate*)scene->getResourceManager()->findResource("TankTemp", "template")
Gideros scaling code#
The above code will instantiate the following code: Now to instantiate this elements within this template in XOML we use the following: Note that because these two parameters are enclosed in $$ they are classed as template parameters. Here we create a template called TankTemp that defined an actor with a name of $name$ and a position of $pos$. Lets take a quick look at creating an actor / child actor with a template When you later instantiate the items within the template the parameters within the template will be replaced by values that are passed to the template. When creating items inside a Template, template parameters are defined using a template parameter name that is enclosed inside double dollar signs ($$), for example $position$. A template also takes any number of parameters that can be passed when you instantiate the template. A template is a XOML tag that allows you to define generic XOML that is not instantiated immediately, yuo can think of a Template as a blue print for something that you will later instantiate into your game or app world. To begin with, lets take a look at what a template actually is and does.
Gideros scaling how to#
New here? What’s IwGame? IwGame is an open source free to use cross platform game engine for iPhone, iPad, Android, Bada, Playbook, Symbian, Windows Mobile, LG-TV, Windows and Mac, built on top of the Marmalade SDK.Ī forum poster asked a question recently that made me realise that XOML Templates can quite easily be overlooked as a means for creating re-usable actors and such, so I thought to help make Templates more visible that I would create a very quick tutorial showing how to use them.
