Difference between revisions of "Tiled"

From GiderosMobile
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
 
'''note:''' you may have to provide your own assets (fonts, gfx, …)
 
 
'''WIP'''
 
  
 
== Description ==
 
== Description ==
Line 10: Line 6:
 
  '''link: https://www.mapeditor.org/'''
 
  '''link: https://www.mapeditor.org/'''
  
Gideros supports maps exported from Tiled with the .lua format.
+
Gideros supports maps exported from Tiled with the .lua format (Tiled: ''File -> Export As -> Lua files (*.lua)'').
 +
 
 +
'''note''': in your Gideros project, don't forget to exclude from execution your Tiled lua files (Gideros: ''right click Tiled lua file -> Exclude from Execution'')
 +
 
 +
Here we will see examples of how to use Tiled for your games. First example will simply load some Tiled levels, then we will integrate '''Liquidfun''' and '''Bump''' as you would probably want to use some kind of collision detection.
 +
 
 +
== Basic Tiled Gideros Integration ==
 +
The first example will show how to display your Tiled levels in Gideros.
 +
 
 +
For images, we will use both Tiled, New Tileset -> "''Based on Tileset Image''" and "''Collection of Images''".
 +
 
 +
Using Tiled Object Layers we will be able to draw Shapes in Gideros (Polygon, Polyline, Rectangles, ...).
 +
 
 +
Please follow this link:
 +
* '''[[Tiled Basics]]'''
 +
 
 +
== Tiled and Liquidfun ==
 +
In the second example, you are using Tiled and '''Liquidfun''' is your physics engine.
 +
 
 +
Beside using images and shapes for display, we will also use shapes for '''Collision shapes''' needed for Liquidfun.
 +
 
 +
Please follow this link:
 +
* '''[[Tiled Liquidfun]]'''
 +
 
 +
== Tiled and Bump (cBump) ==
 +
In the third example, you are using Tiled and '''Bump''' for collision detection.
 +
 
 +
We will be using images and shapes for display. Bump uses only AABB collisions so we won't need shapes for Collision shapes (we will build rectangle collision shapes based on Tiled Rectangle shape).
 +
 
 +
Please follow this link:
 +
* '''[[Tiled Bump]]'''
 +
 
 +
 
 +
----
 +
----
 +
 
 +
== Tiled Deco Shapes ==
 +
Tiled comes with a couple of Shapes ('''ellipse''', '''point''', '''polygon''', '''polyline''', '''rectangle''' and '''text''') to decorate your levels. Those decorative shapes can be used with basic vanilla code, Liquidfun and cBump.
  
'''note''': in your project, don't forget to exclude from execution your Tiled lua file (right click -> Exclude from Execution)
+
Here are the classes to build the Tiled shapes to decorate your levels.
  
Here we will see examples of how to use Tiled for your games, using both '''Liquidfun''' and '''Bump''' as you would probably use one of them for your collision detection.
+
Please follow this link:
 +
* '''[[Tiled Deco Shapes]]'''
  
'''note2''': as I became a big fan of '''ECS''' for building games, I am going to use '''tiny-ECS''' but you can completely ignore it as it has no impact on how to use Tiled in Gideros
+
== Tiled Physics Shapes ==
 +
Tiled comes with a couple of Shapes ('''ellipse''', '''point''', '''polygon''', '''polyline''' and '''rectangle''') to add physics to your levels. Those physics shapes are usually used with '''Liquidfun'''.
  
== Tiled using Collection of Images ==
+
'''note: cBump uses AABB (rectangles) for collision and they are added directly in cBump, so we don't need extra work here'''
Your game is using Tiled Collection of Images (''New Tileset -> Collection of Images'').
 
  
If you are using '''Liquidfun''' as your physics engine, please follow this link:
+
Here are the classes to build the Tiled shapes to decorate your levels ('''Liquidfun''').
* '''[[Tiled Collection of Images Liquidfun]]'''
 
  
If you are using '''Bump''' (cBump) for your collision detection, please follow this link xxx.
+
Please follow this link:
 +
* '''[[Tiled Physics Shapes]]'''
  
== Tiled Based on Tileset Image ==
 
If your game is using Tiled Based on Tileset Image (''New Tileset -> Based on Tileset Image'').
 
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 01:28, 26 October 2025

Description

Tiled is a free and open source, easy to use, and flexible level editor
link: https://www.mapeditor.org/

Gideros supports maps exported from Tiled with the .lua format (Tiled: File -> Export As -> Lua files (*.lua)).

note: in your Gideros project, don't forget to exclude from execution your Tiled lua files (Gideros: right click Tiled lua file -> Exclude from Execution)

Here we will see examples of how to use Tiled for your games. First example will simply load some Tiled levels, then we will integrate Liquidfun and Bump as you would probably want to use some kind of collision detection.

Basic Tiled Gideros Integration

The first example will show how to display your Tiled levels in Gideros.

For images, we will use both Tiled, New Tileset -> "Based on Tileset Image" and "Collection of Images".

Using Tiled Object Layers we will be able to draw Shapes in Gideros (Polygon, Polyline, Rectangles, ...).

Please follow this link:

Tiled and Liquidfun

In the second example, you are using Tiled and Liquidfun is your physics engine.

Beside using images and shapes for display, we will also use shapes for Collision shapes needed for Liquidfun.

Please follow this link:

Tiled and Bump (cBump)

In the third example, you are using Tiled and Bump for collision detection.

We will be using images and shapes for display. Bump uses only AABB collisions so we won't need shapes for Collision shapes (we will build rectangle collision shapes based on Tiled Rectangle shape).

Please follow this link:




Tiled Deco Shapes

Tiled comes with a couple of Shapes (ellipse, point, polygon, polyline, rectangle and text) to decorate your levels. Those decorative shapes can be used with basic vanilla code, Liquidfun and cBump.

Here are the classes to build the Tiled shapes to decorate your levels.

Please follow this link:

Tiled Physics Shapes

Tiled comes with a couple of Shapes (ellipse, point, polygon, polyline and rectangle) to add physics to your levels. Those physics shapes are usually used with Liquidfun.

note: cBump uses AABB (rectangles) for collision and they are added directly in cBump, so we don't need extra work here

Here are the classes to build the Tiled shapes to decorate your levels (Liquidfun).

Please follow this link: