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:
[sourcecode language=”xml”]
<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:
[sourcecode language=”xml”]
<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.

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

  1. gamer says:

    Hi matt,
    really excited about this version . thanks for nice update to engine


  2. drmop says:

    Hi Gamer,

    Good to know. Well I hope you find the new stuff useful. if you want to get to know the new UI quickly, take a quick look at the BasicUI and ComplexUI examples.


  3. Dan says:


    Congratulations on another amazing release. At this point I think IwGame is a production ready game. Next step would be to keep the engine open source, but do a Game Editor for $100 or so. I think there is a huge market for a 2D mobile game engine to rival Unity3D market. Unity3D does 3D very well, but jumps through many many hoops to make decent 2D games, since most successful mobile games are 2D or 2.5D I think a torque2d or scirra construct 2 style editor that can deploy to all platforms would be a beautiful thing to have.

    Matt, do the GUI components have a opacity parameter? The only thing that could be more powerful in the videos was if a designer took the toolkit and made an eye candy showcase 😉

    Amazing how in such a short time IwGame has evolved/revolved… “unfortunately” I am now stuck at doing enterprise mobile applications, but this is a very exciting release… I must find some time to play with it.


  4. drmop says:

    HI Dan,

    Thanks, the UI system was a big undertaking but I’m happy with the result. It opens up the IwGame engine to app development as well as provides a nice UI for games. We are going to extend the UI system to include more business UI element such as bindings to remote XML data and graphs.

    What you suggest is kind of the way we want to go with monetising IwGame as we cannot keep updating it for free forever, because of how much time is involved in updating and supporting it. As we are moving towards a mechanism for monetising (it will always remain free and open source by the way) hence the change to the licensing terms.

    Unfortunately we don’t have any art capacity free at the moment as our artists are snowed under with clients projects


  5. drmop says:

    Oh, forgot to mention that yes actors and all UI elements now support an opacity parameter. In addition you can tell an actor to take into account its parent actors / UI elements opacity, scaling the child by the parents opacity.

  6. Dan says:

    Very cool, can’t wait to give it a try!

    Hopefully some artistic people will read this blog and put some artwork into place. My gfx design skills are extremely outdated, I do know a couple of people with the skills ill try to tweet them about IwGame… (last time I used Photoshop professionally it had a whole different UI 😉 )

    Binding to JSON is more the norm these days at least in HTML5 land, but xml is still very relevant so supporting both would be very nice. JSON is easier to parse and read, and most RESTful web services support JSON as output.

    Yep monetisation is a big issue, looking at how much effort you guys have put into this project, the only way to make it sustainable is to have consulting (services) or associated products (editor, advanced features, etc…). Looking forward to see what’s next 🙂

  7. drmop says:

    Good point, will look at also adding bindings for JSON too.

    Originally we started IwGame to provide a game framework for the Marmalade SDK making it more tempting for game developers, whilst Marmalade is an awesome system, its very low level, which can put many developers off.

    Things changed however after we got XOML up and running. We realised that we had put something together than could rapidly speed up game development and even allow designers instead of programmers to help put together games.

    Then we had the additions of events, actions, modifiers and programs which is pushing the engine towards modular game development, allowing developers to put games together out of blocks using bare minimal coding or no coding at all.

    Finally we have the UI system which opens up IwGame to app developers.

    IwGame has now become a beast so updating it and fixing bugs is becoming costly, so we need to figure out a way to monetise it to keep it alive and growing. We have some ideas on this, which doesn’t involve closing the source down or charging for licensing, these include:

    * A commercial editor
    * Selling extensions, pre-pack game components etc (code / XOML)
    * Top secret idea which we will announce in the near future (if its successful) 🙂

  8. Ralph Trickey says:

    I’m going to get hate mail, but please figure out how to monetize it 😉 I’d rather pay something for a tool that’s updated than see it be outdated. I’m not sure that the Marmalade community is big enough to support an open source project like this.

    One thing you MIGHT consider is making XOML more similar to XAML. I haven’t looked at XOML in enough detail to know how many differences there are, but telling people that it would be a leg up on porting Windows 8 to iOS/other platforms seems like it could be a plus, especially if Windows 8 takes off.

    For people that haven’t seen, Windows 8 includes a native XAML layer accessible from C++, a lot like XOML does, and WPF/SilverLight do for C#.

  9. drmop says:

    Hi Ralph,

    I agree, we do need to find some way of monetising IwGame and we are making steps towards that aim. Unfortunately its a lot of work and a fair way off, but at least we are on track.

    We do plan on adding more features to XOML and as we are basing XOML on XAML concepts you should see XOML move closer toward XAML. We plan on re-writing the XOML system in the hear future to make it more easily extensible, with XOML loaders that are attached to objects, instead of objects providing the XOML parameter parsing.

    Marmalade are going to support deployment to Windows 8 in a release later this year, although I doubt it will include direct support for XAML as W8 will be the only platform that supports it. That said, IwGame will be providing XOML across all supported Marmalade platforms.

Leave a Reply