IwGame Engine v0.35 Released – Multi-touch User Interface, XOML Programs, 9-Patch Rendering and Arrays

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. You can find out more and download the SDK from our IwGame Engine page.

Its been a while since we last released an update for IwGame but 0.35 is finally here. Our plan for this update was to enabled IwGame as a viable app development SDK as well as game development. With the new addition of the user interface we feel that we have made a great stride towards that aim.

Here is the latest list of changes:

IwGame 0.35 Changes:
* XOML schema added. This enables error checking, intellisense and auto completion when creating XOML
* New user interface system added, enabling IwGame as an app developemnt platform. IwGameUI has the following features
* Static and proprtional sizing an margins
* Buttons / toggle / sticky buttons with OnToggledOn and OnToggledOff events
* Labels
* Text input boxes
* Sliders (horizontal and vertical)
* Canvas – Allows organisation of content on a large scrollable canvas area as well as docking of content to edges
* Stack panels and wrap panels (horizontal and vertical) allow organisation of content in vertical and horizontal stacks
* Wrap panel (horizontal and vertical), works much in the same way as an orinary stack panel exceot content that overflows the edge of the panel will wrap down to the next line or across to the next column
* Listbox (horizontal and vertical) allows organisation and selection of content using sigle and multi-select. Can use templates and bindings for automatic binding of data to the list box
* Grid allows the display and navigation of two dimensional data, each column or the whole grid can be bound to data and templates.
* Image view that allows the display and navigation of large images (supports panning and pinch zoom), can also contain any other UI or actor
* Text view that allows the display and navigation of text (supports panning and pinch zoom)
* Web view – A wrapper for Marmalades Web API. Multiple web views cn abe instantiated inside the UI
* TabBar (horizontal and vertical) – A tab bar allows the display of multiple pages or views of content. The tab bar can be orientated horizontally or vertically. Tab bar can appear at top, bottom, left or right of control area. View swicthing can also be animated using a selection of preset animations or using your own custom animations.
* All UI elements are supported in XOML, fully bindable and integrates directly into all other systrems including the animation system.
* Container UI elements will clip children. Container actors also allow the specification of a clip margin.
* Scrolling and zooming supports iOS style spring effect to place contents back into position when going over boundaries
* All UI elements support hide and show timelines
* Rendering system now supports 9-patch rendering using 9-patch brushes
* Sprite system now supports 4 parameter skewing
* IwGameInput system reworked to make it more multi-touch friendly
* XOML now fully supports multi-touch events (up to 5 simultaneous events)
* Event bubbling added, enabling touch events to travel up to parent actors
* Actors and scenes now support proportional sizing
* Actors now support margins and docking to screen edges
* Actor touch events now provide the touch index that causes the event
* Sprites / actors can now scale their opacity by their parents
* Delta animations targeting position, scale, rotation, colour and opacity will apply the update from the original value that was assigned to the actor
* Actors now support simple bindings. Simple bindings are a simple binding of a variable to an actors property without having to create a full bindings list
* Actors can now be created from a brush. Using brushes instead of images, allows you to create image based actors without having specify a visual size
* Scenes and actors now support dynamic resizing and orientation changes
* Support for array variables added
* System XOML variable array added. Allows you to query current display width, height, mode, device type, multi-touch / compass, accelerometer, keyboard support. Also provides a rating hint as to the size of the display, which you can be used to determine size of fonts etc
* New program / command system added, This new system is a very powerful way of creating game or app flow logic in XOML
* New DebugText action that displays the value of a XOML variable / text to the debug output
* New ChangeProgram action that allows the modification of running programs
* New CIwGameAnimUtil class added that enables creation o simple timelines in code
* Images now support filtering and format conversion in code and in XOML
* CIwGameRender2d now supports rendering of images fom short vectors. These types of images will not use the data cache
* Actor / sprite rendering optimised to cut down processing of actors / sprites not on screen or visible
* Sprite system completely changed to support heirarchical rendering
* Text rendering optimised when not rotated
* Fonts, images and XOML files can now be conditionally loaded
* Scene FixedAspect and LockWIdth have been deprecated. Scenes now use the new CanvasFit option which supports canvas fitting to Width, Height, Both, None and Best Fit
* Physics can be disabled for a complete scene to reduce processing
* IwGame class now uses layer ordering to determine priority of touch events
* Re-arranged XOML tags and tag attributes, placing more commonly used tags / attributes earlier to speed up XOML parsing
* Touch focus is now released when user touches an actor and moves their finger away from the actor by more than double the radius. Touch focus is also released when camera is panned in scenes that have touch panning enabled.
* Frame rate cap has been removed
* BUG FIX: When releasing scene touch panning on an actor it no longer takes it as a tap on the actor
* BUG FIX: Mip-mapping globally disabled as it was causnig many rendering artefect issues
* BUG FIX: camera touch pan scaling, camera pan now follows finger accurately
* BUG FIX: Attempting to instantiate a template inside an actor crashed has now been fixed
* BUG FIX: Fixed issue with bool variable add method
* BUG FIX: CIwGameActor::setAngularVelocityDamping() fixed
* BUG FIX: Fixed issue where releasing a scene touch pan on an actor will send the OnBeginTouch event to the actor

As you can see that’s an immense bunch of changes. if you have been following the real-time updates in the forum then you will probably be aware of many of these changes: I can tell you one thing for sure, I did not enjoy updating the documentation

Lets take a more in-depth look at some of these new changes:

User Interface

The biggest change in 0.35 is the additional of the user interface system IwGameUI. Our aim was to create a user interface system that was good for both app and game development. With this aim in mind we believe we have created a user interface system that is better, more versatile and more extensible than currently available user interface systems.

Here are the main features of IwGameUI:

  • Data binding (two way in some cases). Data binding allows you to map XOML variables / arrays to UI elements and when those variables change the changes are reflected in the user interface components
  • 14 different kinds of controls (buttons, icons, labels, text boxes, list boxes, grids, sliders, canvas, stack panels, wrap panels, image views, text views, web views and tab bars)
  • Support for events and actions, such as handling button toggling, selection and value changes.
  • Fully integrated into IwGame’s animation system
  • Styling and templating
  • 9-patch rendering which allows you to render clean looking buttons / borders without losing resolution
  • Supports modifiers and other customisations, allowing you to augment the behaviour of UI elements
  • Supports proportional sizing
  • Supports dynamic orientation / screen size changes
Ywo example projects have been included with 0.35 that show a basic UI and a cmoplex UI. Yuo can see a video of the complex UI at http://www.youtube.com/watch?v=ZImWhKwV1tA

Heres a quick example of a little bit of UI defined in XOML:

        <StackPanel Background="PanelBrush" Orientation="horizontal" Size="-95, 100" AlignV="middle" Margin="0, 0, 10, 10">
            <Icon Background="Button1Brush" Margin="20, 0, 0, 0" />
            <Icon Background="Button2Brush" Margin="20, 0, 0, 0" />
            <Icon Background="Button3Brush" Margin="20, 0, 0, 0" />
            <Icon Background="Button4Brush" Margin="20, 0, 0, 0" />

This bit of XOML will create a stack panel that contains 4 icons stacked horizontally at the side of each other. Notice that the width of the stack panel is set to –95. The new negative sizes represent proportional sizing, with –95 meaning either 95% of the parents container size or if no parent, 95% of the screen size.

Programs and Commands

Whilst the events / actions system is great for handling the event based parts of your game we felt that we needed a new system that would allow some kind of game / app logic scripting that would enable developers to define sets of complex functionality that can be ran at any point during the apps lifetime. Obviously as we are programmers we felt a program / command style system would feel most natural. We also felt that we needed a versatile system that the developer could completely customise to suite their needs, so we added the program system. IwGame’s program system allows developers to create complex programs from a list of hierarchical commands. Commands are executed in the order in which they are declared until the end of the program is reached. Commands can also executed concurrently, allowing the program to run multiple commands together each frame. Lets take a look at a quick program example:

        <Program Name="Main" AutoRun="true" Priority="true">
            <Command Parallel="true">
                <Command Method="show_video" Param1="IntroVideo" />
                <Command Method="run_actions" Param1="StartAnimation" Param2="Door" />
            <Command Method="show_speech" Param1="0" Param2="Hey how ya doing?" />
            <Command Method="show_speech" Param1="0" Param2="Tap that door" />
            <Command Method="wait_tapped" Param1="Door" />
            <Command Method="set_property" Param1="Timeline" Param2="RemoveItemAnim" Param3="Door" />
            <Command Method="wait_tapped" Param1="ID Card" /> <Command Method="add_inventory" Param1="ID Card" />
            <Command Method="load_scene" Param1="Scene2.xml" />

We define a program named “Main” and tell I to automatically run when the scene is loaded. We set the program as a priority program, which means it is executed before all other programs.

Next we add a command that executes two other commands in parallel. This will show an intro video and start a door animation. Once complete the player will be shown the “Hey how ya doing” speech and so on and so forth.

As you can see using the program system it becomes an incredibly easy process to define complex logical game and app flow.

Multi-touch in XOML

XOML now supports multi-touch events for actors. Actors can now respond to up to 5 simultaneous taps, begin and end touches. For example, you could control 5 actors at the same time on screen in a game, or create a cool user interface element that utilises more than one finger, like we have done with pinch zoom image and text view controls.

Proportional Sizing, Docking, 9-Patch Brushes and Orientation Changes

We now support proportional sizing of actors and margins, allowing you to create game and app layouts that are completely screen size independent. Actors can now be docked to the edges of the screen and canvas containers. 9-Patch brushes now allow the rendering of images where you want to retain the clean 1:1 pixel border around an image. All actors and scenes can now detect and handle orientation changes. Any actors or UI elements that are declared as proportionally sized will automatically be resized for you when the screen resolution changes. In addition, if no size is specified when creating an actor the actors assigned brush size will be taken as its visual size. We recommend that you create all actors from brushes to take full advantage this feature.

Array Variables, System Variables and Simple Bindings

XOML now supports the creation and definition of array variables. The bindings system also works with the array system. To access a particular element of an array to a property you would use variable_name:array_index, instead of simply variable_name.

A new system array has been added by default to the XOML system. This allows you to query certain aspects of the system such as display size, support for multi-touch etc..

Actors can also use simple bindings. A simple binding is a binding without a bindings collection which allows you to bind a single variable to a single actor property, e.g:

<ActorText Name="NameLabel" ......... Binding="[Text]ProfileName:2" />

In the above example we bind the 3rd index of the ProfileName array to the Text property of NameLabel.

Event Bubbling

Actors now support bubbling of touch events. Actors can be marked to receive input events from their child actors

Actor and sprite optimisations

We have gone through and optimised the actor and sprite systems to cut down a lot of rendering and processing of actors / sprites that are clipped or off screen.

Scene Virtual Canvas Sizing

We have changed the way a scenes canvas sizing is set-up to make it more versatile. You can now choose the method by which iwGame scales your scenes to the final display as well as choose the scenes origin

Image filtering and format conversion

When images are declared in XOML you can now specify if they should be filtered when rendered. You can also specify the format that you would like the image to be converted to before uploaded to texture RAM, reducing the size of your texture RAM usage.

Licensing Terms Updated

The licensing terms for IwGame Engine usage has been changed. Whilst there are other minor changes, the main change is:

You may not use the IwGame Engine or any of its parts to create products that can be used to create other apps and games for mobile devices without express prior written notice from an executive of Pocketeers Limited with the correct authority to grant authorisation.

IwGame Engine 0.35 coming this weekend with luck

Its been a long hard slog getting the UI update in but we finally feel confident that there are enough features in the UI system now to release IwGame 0.35 this week / early next week.  The new bindable UI makes the IwGame engine equally potent as a general app development engine as well as a game engine. In fact, using XOML I dare say its much easier to develop apps using the IwGame that it is any of the native SDK’s (Hmm, maybe the engine needs a new name  :))

Unfortunately there have been a massive number of changes within the engine, which means many of the original engine files have also been changed, so if you are thinking of merging then its not going to be easy. We are currently working on  documentation and what not, which unfortunately is going to take some time due to the large number of changes. That said the wait will be worth it as we believe 0.35 is our best release yet enabling developers to not only create awesome games with ease but also awesome apps with ease.


Marmalade SDK 6.0.2 Released

Marmalade have just released 6.0.2 of their awesome SDK. Looking at the change list there are some very welcome bug fixes:

  • Exporters: Added support for Maya 2013 and Max 2012
  • iOS: touches are no longer passed to the surface below the web view
  • iOS: s3eOSReadString now handles split keyboards correctly
  • iOS: added s3eEdkAppGetInitialOpenURL to get the initial open URL
  • android: fixed icf splash screens when fixing rotation
  • playbook: s3eOSReadString now cancels properly
  • IwHTTP: fixed to work without threads
  • Added menu options to Windows simulator for Retina display
  • OSX: fixed to make building extensions possible
  • Android splash fixed when using dispfixrot=2
  • android: building of EDK modules
  • ios: WebView orientation (IwGX and s3eWebView) on iPad
  • android: fixed crash with image property in CImagePtr when loading a png file

There is however a crash issue with Bada builds

Yet another IwGame Engine UI Progress Update

Not had a great deal of spare time to spend on the UI this week but did manage to get a few cool things in there including:

  • Scrolling grids
  • Scrolling list boxes
  • Horizontal list boxes
  • 9-patch brushes
  • Child element sizing based on percentage of parent
  • Child clipping
  • Grid per column bindings
  • Dynamic resizing of elements, grids and list boxes will automatically re-layout child elements to make use of extra space
  • UI elements can allow touch events to bubble up to parent elements allowing them to also receive the same events
  • Tidied up the UI input system
  • 4 parameter skewing – See the wonky text on the large and small buttons for an example

Heres a quick screen shot showing the current UI demo:

More Advanced IwGame Engine UI Screen Shot

More Advanced IwGame Engine UI Screen Shot

Those frogs look happy to be sat in that list box like that :)

And here’s a new and better video showing the new UI http://www.youtube.com/watch?v=IhtT_e5u8gU

I hope to spend a few additional weeks on implementing more UI controls such as sliders and tab vies etc.. before we released 0.35.

Luck Bubbles – Why some are luckier than others

Last year I was sat in the garden on the swing in the blazing son, relaxing and thinking up nonsense. I happened to think  back to a chat I had with my father some years before where he said that “if there was no bad luck in the Universe then he would have no luck at all”, I found the comment quite amusing at the time. However, years later after suffering at the hands of rotten luck for a while it got me to thinking about why some are lucky and some are not.

My mind is a strange one and loves a thinking challenge, so it began running through hundreds of possible theories. One theory I quite liked was the “Luck Bubbles” theory (not an official theory as far as I know). In this theory, Luck Bubbles are basically areas of luck that exist in 4-dimensional space-time. They float around and are attracted to positive thoughts / energies. If an area at a specific time has a particularly strong attraction then Luck Bubbles will congregate there for a while.

Luck Bubbles change the nature of positive chance events in the area that they cover, being stronger towards their centre and tapering off towards the edges. Conversely bad luck bubbles also exist in this theory which have the exact opposite affect of good luck bubbles tending to congregate around negative energies / thoughts.

So maybe luck is a state of mind? Positive thoughts could lead to better luck. Next time you put the lottery on or release a new app, think positive just in case.

Well, I’m off to travel the globe tossing a coin to test my theory :D

IwGame UI Progress Update

Got a quick update showing how the IwGame engines UI system is shaping up. Note that the UI system is “bitmap” based and IwGame does not draw things like buttons, grids etc.. manually. Here’s a quick screen shot at iPad resolution showing some basic UI:

Basic IwGame Engine UI Screenshot

Basic IwGame Engine UI Screenshot

This is just a static image however, so you cannot really see the animation that’s built into the UI, for that you need to take a look at a quick video I stuck together showing the UI in action at http://www.youtube.com/watch?v=oV3kYLbzcKo


The UI itself consists of the following elements:

  •  StackPanels – The top left hand control is a vertical stack panel containing 3 horizontal stack panels. Each horizontal stack panel contains multiple basic UI components including buttons, labels and text input boxes. The check boxes and the long named button are toggle buttons. The top stack panel and the components within the panel have been draggable so they can be dragged away from the stack panel and moved around. Tapping the Expert check box will spin the control 360 degrees using an animation time line. One of the buttons and two of the check boxes also have animation time lines applied to them.
  • Grid – The control to the bottom left is a 3×4 grid that contains 12 items. These items are simple label buttons that when tapped will animate. A XOML array variable is bound to the grid and data from the array is moved into the grid. Updating the XOML array will automatically update the grid elements. The types of elements within the grid are defined using an item template. You can create a grid manually by adding components directly to the grid in XOML or in code bypassing the binding system. This allows you to create more complex controls within each grid cell. Tapping an item in the grid will set it animating
  • List box – The list box to the top right work on the same principles as the grid where data is bound to the list box and a template can be specified that defnies the type of items. This list box is a multi-select list box which allows you to select multiple  items
  • List Box 2 – The list box to the bottom right is more complex list box that shows list items using a more complex control. The list box items in this instance are created using a horizontal stack panel, which contains a label and a button. The list box is a single item selection list box

The UI controls themselves can be moved around and placed anywhere in the scene. the whole scene can also be moved around.

To give you an idea as to how the XOML looks, here’s a short code clip showing the XOL that creates the list box to the upper right of the screen:

    <!-- Create a listbox --> 
    <!-- ListBoxItems - Defines a list of items that will be bound to the list box -->
    <Variable Name="ListBoxItems" Type="arraystring" Size="4" Value="Item 1, Item 2, Item 3, Item 4" />
    <!-- Create a template that will be used to generate the list box actors -->
    <Template Name="ListBoxItemTemp">
        <Label Name="ListItem$index$" Background="ListBoxItemBrush" BackgroundColour="200, 200, 200, 255" SelectedColour="80, 80, 255, 255" Font="trebuchet_12" TextColour="255, 255, 255, 255" SelectedTextColour="255, 255, 255, 255" Margin="0, 0, 20, 0" SelectType="toggle" Selected="false" />
    <ListBox Name="ListBox" Position="351, -190" Background="ListBoxBrush" MultiSelect="true" ItemsData="ListBoxItems" ItemsTargetType="text" ItemsTemplate="ListBoxItemTemp" HitTest="true" Draggable="true" />


As you can see its pretty straight forward:

  • We create an array string variable and assign it the data that will be bound to the list box
  • We create a template that represents our items
  • We create a list box that uses the template and data and make it draggable

Well that’s it for now. We will be adding more and more features to the UI over the coming weeks and will keep you updated.


Pocketeers Limited is taking on New Mobile Projects

Pocketeers Limited Mobile Developer Logo

Pocketeers Limited Mobile Developer


Need a mobile game or app developed across multiple platforms (iPhone, iPad, Andriod,Bada, PlayBook etc..) at little extra cost? Or maybe you need a rapid prototype of your next game or app idea creating as proof of concept?

Pocketeers Limited a UK based mobile app and game developer (established in 2002) responsible for the creation of the IwGame Engine are looking to take on additional gaming and app projects. Pocketeers will consider any size project, but will favour those projects that utilise the IwGame engine / Marmalade SDK. Pocketeers have worked with clients large and small including the likes of Electronic Arts, Destination Software, Ideaworks, Honey Badger Studios, Tournay Software, and others.  Pocketeers provide a full range of services including design, coding, art work, audio and testing at very competitive prices.

For more details you can contact Pocketeers Limited via the web at http://www.pocketeers.co.uk/?page_id=8