From The Blog: Using Tiled for layout and level design

Funny you should say that… We actually have some “button” classes but I didn’t want to confuse people by adding another layer of abstracted classes in. Our button classes do few cool things:

  1. Listen for mouse events and get scale up on mouseOver

  2. Listen to touch events and scale down on push

  3. Listen to keyPress events for a shortCut key  

  4. Broadcast “pressed” and “released” events that have an event.buttonName that pass the name of the button

So it becomes super-simple to build a UI with a single listener that has something like this in it

onUI(event) local phase, name = event.phase, event.buttonName if phase == "released" then if name == "play" then composer.gotoScene( "scene.game" ) end end end Runtime:addEventListener("UI", onUI)

In the game we are currently working on, we build all of our UI (including level select) in tiled, but I haven’t refactored it into the new UI classes. Once I do, I’ll have a nice test case to work with…

Aq2N7vk.gif

Eventually I’d like to build toggles, sliders, etc. and release a Tiled GUI project.

Is that the end of the video series? Or as mentioned there are plans for more? I just don’t at the moment understand the leap from what you showed to the actual game. Is there an exporter? A tool you run the tile file through?

Yes. There are more on the way… More nuts and bolts of loading files and adding properties.