All Projects → HaxePunk → tiled

HaxePunk / tiled

Licence: other
Tiled TMX import for HaxePunk

Programming Languages

haxe
709 projects
shell
77523 projects

Projects that are alternatives of or similar to tiled

cl-tiled
Tiled map library for CL
Stars: ✭ 15 (-70.59%)
Mutual labels:  tiled
tuile
Tuile (french for tile) is a 2D graphics engine inspired from old hardware and based on layers, tiles sets, tile maps and sprites. Its scanline rendering pipeline makes it perfect for raster effects.
Stars: ✭ 19 (-62.75%)
Mutual labels:  tiled
tbag
Tea-bag is Third party extension utility project
Stars: ✭ 13 (-74.51%)
Mutual labels:  tiled
pixi-tiled
TILED importer for PIXI. Support Images, Shapes, Layers.
Stars: ✭ 19 (-62.75%)
Mutual labels:  tiled
Protobuf-Dreamer
A tiled DeepDream project for creating any size of image, on both CPU and GPU
Stars: ✭ 39 (-23.53%)
Mutual labels:  tiled
autotiler
Autotile 47-tile blob tileset generator application with Godot export support. Based on Electron JS.
Stars: ✭ 32 (-37.25%)
Mutual labels:  tiled
Tiled-Amethyst-Example
Simple example for drawing a map made with Tiled with Rust and Amethyst.
Stars: ✭ 16 (-68.63%)
Mutual labels:  tiled
tilepix
Library for combining tiled maps with pixel
Stars: ✭ 40 (-21.57%)
Mutual labels:  tiled
Driftwood
Driftwood 2D Tiling Game Engine and Development Suite
Stars: ✭ 23 (-54.9%)
Mutual labels:  tiled
Berry
Berry is a simple Tiled Map Loader for Corona SDK.
Stars: ✭ 16 (-68.63%)
Mutual labels:  tiled
SpinePunk
HaxePunk renderer for the Haxe Spine runtime
Stars: ✭ 20 (-60.78%)
Mutual labels:  haxepunk
RawSalmonEngine
A game engine utilising "Tiled" map files
Stars: ✭ 15 (-70.59%)
Mutual labels:  tiled
HaxePunk-UI
A Haxe port of the punk.ui project.
Stars: ✭ 17 (-66.67%)
Mutual labels:  haxepunk
rs-tiled
Reads files from the Tiled editor into Rust
Stars: ✭ 223 (+337.25%)
Mutual labels:  tiled
flame tiled
Package to add Tiled support for the Flame game engine
Stars: ✭ 21 (-58.82%)
Mutual labels:  tiled
Valhalla
Open Source Routing Engine for OpenStreetMap
Stars: ✭ 1,794 (+3417.65%)
Mutual labels:  tiled
Melonjs
a fresh & lightweight javascript game engine
Stars: ✭ 3,721 (+7196.08%)
Mutual labels:  tiled
pcxtools
MSX cross-development command line tools PNG2MSX, PNG2SPR[+] and TMX2BIN
Stars: ✭ 17 (-66.67%)
Mutual labels:  tiled

Build Status

HaxePunk Tiled

Add the HaxePunk Tiled library to your game

You need to add

<haxelib name="HaxePunkTmx" />

to your project.xml file.

Add your maps to project.xml

<assets path="assets/maps" rename="maps" include="*.tmx" />

Load a map layers and collision

To use this as a background image simply create a new instance of TmxEntity.

import haxepunk.tmx.TmxEntity;

public function createMap()
{
  // create the map
  var e = new TmxEntity("maps/mylevel.tmx");

  // load layers named bottom, main, top with the appropriate tileset
  e.loadGraphic("graphics/tileset.png", ["bottom", "main", "top"]);

  // loads a grid layer named collision and sets the entity type to walls
  e.loadMask("collision", "walls");

  add(e);
}

Access properties and objects

To access map properties and object layers create an instance of TmxMap. To add it to the scene simply pass the TmxMap object to the TmxEntity constructor.

import haxepunk.tmx.TmxEntity;
import haxepunk.tmx.TmxMap;

public function createMap()
{
	// create the map
	var map = TmxMap.loadFromFile("maps/mylevel.tmx");

	// access map properties
	var prop = map.properties.resolve("myCustomProperties");

	// go through the list of objects in an object layer
	for(object in map.getObjectGroup("myObjectsLayer").objects)
	{
		// you can access:
		object.name;
		object.type;

		object.x;
		object.y;

		object.width;
		object.height;

		// to read custom properties
		object.custom.resolve("myProp");
	}

	// create the map
	var e = new TmxEntity(map);

	// load layers named bottom, main, top with the appropriate tileset
	e.loadGraphic("graphics/tileset.png", ["bottom", "main", "top"]);

	// loads a grid layer named collision and sets the entity type to walls
	e.loadMask("collision", "walls");

	add(e);
}

MIT License

Copyright (C) 2012-2018 HaxePunk contributors (original by Thomas Jahn)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].