<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Game map edition using Tiled</title>
	<atom:link href="http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/feed/" rel="self" type="application/rss+xml" />
	<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/</link>
	<description>come with me, on the way I&#039;ll explain.</description>
	<lastBuildDate>Tue, 16 Mar 2010 22:54:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Angel</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-4779</link>
		<dc:creator>Angel</dc:creator>
		<pubDate>Mon, 18 Jan 2010 12:42:39 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-4779</guid>
		<description>hi, you&#039;ve stated that you were going to write a tutorial on how to import the map into a java game, do you have this tutorial, i could really use it</description>
		<content:encoded><![CDATA[<p>hi, you&#8217;ve stated that you were going to write a tutorial on how to import the map into a java game, do you have this tutorial, i could really use it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elias Maluco</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-4722</link>
		<dc:creator>Elias Maluco</dc:creator>
		<pubDate>Sat, 26 Dec 2009 21:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-4722</guid>
		<description>para colisão e qualquer outra propriedade que se desejar coloacar nas tiles pode-se fazer em Tileset-&gt;Tileset Manager-&gt;botão edit
Escolha a tile e coloque as propriedades que quiser (colisão, dano - se a tile for um espinho por exemplo) e assim vai...</description>
		<content:encoded><![CDATA[<p>para colisão e qualquer outra propriedade que se desejar coloacar nas tiles pode-se fazer em Tileset-&gt;Tileset Manager-&gt;botão edit<br />
Escolha a tile e coloque as propriedades que quiser (colisão, dano &#8211; se a tile for um espinho por exemplo) e assim vai&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Silveira</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3750</link>
		<dc:creator>Silveira</dc:creator>
		<pubDate>Mon, 11 May 2009 21:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3750</guid>
		<description>Chris, right now I&#039;m mapping it by hand. I wrote a few posts on that, http://silveiraneto.net/2008/11/06/javafx-defuse-the-bomb/ and http://silveiraneto.net/2008/10/30/javafx-rectangular-collision-detection/.
The best thing to do is use the a layer in the Tiled itself to map the collision blocks.</description>
		<content:encoded><![CDATA[<p>Chris, right now I&#8217;m mapping it by hand. I wrote a few posts on that, <a href="http://silveiraneto.net/2008/11/06/javafx-defuse-the-bomb/" rel="nofollow">http://silveiraneto.net/2008/11/06/javafx-defuse-the-bomb/</a> and <a href="http://silveiraneto.net/2008/10/30/javafx-rectangular-collision-detection/" rel="nofollow">http://silveiraneto.net/2008/10/30/javafx-rectangular-collision-detection/</a>.<br />
The best thing to do is use the a layer in the Tiled itself to map the collision blocks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3749</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 11 May 2009 05:18:49 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3749</guid>
		<description>And how do you make it so that you can&#039;t pass through walls and stuff...like a collision layer?</description>
		<content:encoded><![CDATA[<p>And how do you make it so that you can&#8217;t pass through walls and stuff&#8230;like a collision layer?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3748</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 11 May 2009 05:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3748</guid>
		<description>I was wondering what exactly the &quot;Add Object Group&quot; does?</description>
		<content:encoded><![CDATA[<p>I was wondering what exactly the &#8220;Add Object Group&#8221; does?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3737</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sun, 03 May 2009 21:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3737</guid>
		<description>many thanks!  helped me get started.</description>
		<content:encoded><![CDATA[<p>many thanks!  helped me get started.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcelo</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3715</link>
		<dc:creator>Marcelo</dc:creator>
		<pubDate>Mon, 27 Apr 2009 10:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3715</guid>
		<description>Hi.. Parece que o blog pensou que generics era html. 
Apaga o comment de cima. 
Postei o código aqui: http://freetexthost.com/tnihvpted5</description>
		<content:encoded><![CDATA[<p>Hi.. Parece que o blog pensou que generics era html.<br />
Apaga o comment de cima.<br />
Postei o código aqui: <a href="http://freetexthost.com/tnihvpted5" rel="nofollow">http://freetexthost.com/tnihvpted5</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcelo</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3714</link>
		<dc:creator>Marcelo</dc:creator>
		<pubDate>Mon, 27 Apr 2009 10:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3714</guid>
		<description>Vou postar aqui mesmo. Gera um jar com esta classe aí embaixo, e com este manifest e joga no diretório pluguins do tiled

Manifest
----------------------------
Manifest-Version: 1.0
Writer-Class: tiled.plugins.fx.FXMapWriter
-----------------------------

Classe de exportação do Plug-in
------------------------------------
package tiled.plugins.fx;

import java.awt.Rectangle;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Formatter;
import java.util.HashMap;
import java.util.Iterator;
import tiled.core.Map;
import tiled.core.TileLayer;
import tiled.core.TileSet;
import tiled.io.MapWriter;
import tiled.io.PluginLogger;

public class FXMapWriter implements MapWriter
{
	public void writeMap(Map map, String filename) throws IOException
	{
		writeMap(map, new FileOutputStream(filename));
	}

	public void writeMap(Map map, OutputStream out) throws IOException {
		Iterator ml;
		TileLayer layer;

		ml = map.getLayers();

		Formatter writer = new Formatter(out);
        int pos1 = map.getFilename().lastIndexOf(File.separator) + 1;
        String n = map.getFilename().substring(pos1).replace(&quot;.&quot;, &quot;_&quot;);
        
        writer.format(&quot;// Generated by Tiled - JavaFX Pluguin \r\n&quot;);
        writer.format(&quot;var %s = Tilemap {\r\n&quot;, n);
        writer.format(&quot;\twidth: %d\r\n&quot;, map.getWidth());
        writer.format(&quot;\theight: %d\r\n&quot;, map.getHeight());
        writer.format(&quot;\ttileWidth: %d\r\n&quot;, map.getTileWidth());
        writer.format(&quot;\ttileHeight: %d\r\n&quot;, map.getTileHeight());
        Rectangle b = map.getBounds();
        writer.format(&quot;\tbounds: javafx.geometry.Rectangle2D {\r\n&quot;);
        writer.format(&quot;\t\tminX: %d\r\n&quot;, b.x);
        writer.format(&quot;\t\tminY: %d\r\n&quot;, b.y);
        writer.format(&quot;\t\twidth: %d\r\n&quot;, b.height);
        writer.format(&quot;\t\theight: %d\r\n&quot;, b.width);
        writer.format(&quot;\t}\r\n&quot;);
        writer.format(&quot;\timages: [\r\n&quot;);

        java.util.Map tileMap = new HashMap();
		ml = map.getLayers();
        while (ml.hasNext()) {
			layer = (TileLayer)ml.next();
            for (int y = 0; y &lt; layer.getHeight(); y++)
                for (int x = 0; x &lt; layer.getWidth(); x++) {
                    if (layer.getTileAt(x, y)!=null) {
                        TileSet ts = layer.getTileAt(x, y).getTileSet();
                        if (!tileMap.containsKey(ts)) {
                            writer.format(&quot;\t\tjavafx.scene.image.Image {\r\n&quot;);
                            String s = new File(layer.getTileAt(x, y).getTileSet().getTilebmpFile()).toURI().toURL().toString();
                            writer.format(&quot;\t\t\turl: \&quot;%s\&quot;\r\n&quot;, s);
                            tileMap.put(ts, tileMap.size());
                            writer.format(&quot;\t\t},\r\n&quot;);
                        }
                    }
                }
        }
        writer.format(&quot;\t]\r\n&quot;);
        
        ml = map.getLayers();
        writer.format(&quot;\tlayers: [\r\n&quot;);
		while (ml.hasNext()) {
			layer = (TileLayer)ml.next();
            writer.format(&quot;\t\tTilelayer {\r\n&quot;);
            writer.format(&quot;\t\t\tname: \&quot;%s\&quot;\r\n&quot;, layer.getName());
            writer.format(&quot;\t\t\twidth: %d\r\n&quot;, layer.getWidth());
            writer.format(&quot;\t\t\theight: %d\r\n&quot;, layer.getHeight());
            writer.format(&quot;\t\t\tvisible: %s\r\n&quot;, layer.isVisible());
            writer.format(&quot;\t\t\ttiles: [&quot;);
            for (int y = 0; y &lt; layer.getHeight(); y++) 
                for (int x = 0; x &lt; layer.getWidth(); x++)
                    if (layer.getTileAt(x, y)!=null)
                        writer.format(&quot;%d,&quot;, layer.getTileAt(x, y).getId() );
                    else
                        writer.format(&quot;-1,&quot;);
            writer.format(&quot;]\r\n&quot;);
            writer.format(&quot;\t\t\timages: [&quot;);
            for (int y = 0; y &lt; layer.getHeight(); y++)
                for (int x = 0; x  - 1) {
                            var imgIndex = layer.tileImage(col, row);
                            var imageTilesPerRow = (images[imgIndex].width / tileWidth) as Integer;
                            insert
                            ImageView {
                                image: images[imgIndex];
                                x: col * tileWidth
                                y: row * tileHeight
                                viewport: Rectangle2D {
                                    minX: ( tileValue mod imageTilesPerRow ) * tileWidth
                                    minY: ( tileValue / imageTilesPerRow ) * tileHeight
                                    height: tileWidth,
                                    width: tileHeight
                                }
                            }
                            into con;
                        }
                    }
                }
        }
        return Group {
            content: con;
        };
    }

}

public class Tilelayer {
    public-init var name: String;
    public-init var width: Integer = 10;
    public-init var height: Integer =  10;
    public-init var tiles: Integer[];
    public-init var images: Integer[];
    public-init var visible: Boolean;

    public function tileValue(x: Integer, y: Integer) : Integer {
        return tiles[x + (y * width) ];
    }

    public function tileImage(x: Integer, y: Integer) : Integer {
        return images[x + (y * width) ];
    }

}</description>
		<content:encoded><![CDATA[<p>Vou postar aqui mesmo. Gera um jar com esta classe aí embaixo, e com este manifest e joga no diretório pluguins do tiled</p>
<p>Manifest<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Manifest-Version: 1.0<br />
Writer-Class: tiled.plugins.fx.FXMapWriter<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Classe de exportação do Plug-in<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
package tiled.plugins.fx;</p>
<p>import java.awt.Rectangle;<br />
import java.io.File;<br />
import java.io.FileOutputStream;<br />
import java.io.IOException;<br />
import java.io.OutputStream;<br />
import java.util.Formatter;<br />
import java.util.HashMap;<br />
import java.util.Iterator;<br />
import tiled.core.Map;<br />
import tiled.core.TileLayer;<br />
import tiled.core.TileSet;<br />
import tiled.io.MapWriter;<br />
import tiled.io.PluginLogger;</p>
<p>public class FXMapWriter implements MapWriter<br />
{<br />
	public void writeMap(Map map, String filename) throws IOException<br />
	{<br />
		writeMap(map, new FileOutputStream(filename));<br />
	}</p>
<p>	public void writeMap(Map map, OutputStream out) throws IOException {<br />
		Iterator ml;<br />
		TileLayer layer;</p>
<p>		ml = map.getLayers();</p>
<p>		Formatter writer = new Formatter(out);<br />
        int pos1 = map.getFilename().lastIndexOf(File.separator) + 1;<br />
        String n = map.getFilename().substring(pos1).replace(&#8220;.&#8221;, &#8220;_&#8221;);</p>
<p>        writer.format(&#8220;// Generated by Tiled &#8211; JavaFX Pluguin \r\n&#8221;);<br />
        writer.format(&#8220;var %s = Tilemap {\r\n&#8221;, n);<br />
        writer.format(&#8220;\twidth: %d\r\n&#8221;, map.getWidth());<br />
        writer.format(&#8220;\theight: %d\r\n&#8221;, map.getHeight());<br />
        writer.format(&#8220;\ttileWidth: %d\r\n&#8221;, map.getTileWidth());<br />
        writer.format(&#8220;\ttileHeight: %d\r\n&#8221;, map.getTileHeight());<br />
        Rectangle b = map.getBounds();<br />
        writer.format(&#8220;\tbounds: javafx.geometry.Rectangle2D {\r\n&#8221;);<br />
        writer.format(&#8220;\t\tminX: %d\r\n&#8221;, b.x);<br />
        writer.format(&#8220;\t\tminY: %d\r\n&#8221;, b.y);<br />
        writer.format(&#8220;\t\twidth: %d\r\n&#8221;, b.height);<br />
        writer.format(&#8220;\t\theight: %d\r\n&#8221;, b.width);<br />
        writer.format(&#8220;\t}\r\n&#8221;);<br />
        writer.format(&#8220;\timages: [\r\n");</p>
<p>        java.util.Map tileMap = new HashMap();<br />
		ml = map.getLayers();<br />
        while (ml.hasNext()) {<br />
			layer = (TileLayer)ml.next();<br />
            for (int y = 0; y &lt; layer.getHeight(); y++)<br />
                for (int x = 0; x &lt; layer.getWidth(); x++) {<br />
                    if (layer.getTileAt(x, y)!=null) {<br />
                        TileSet ts = layer.getTileAt(x, y).getTileSet();<br />
                        if (!tileMap.containsKey(ts)) {<br />
                            writer.format("\t\tjavafx.scene.image.Image {\r\n");<br />
                            String s = new File(layer.getTileAt(x, y).getTileSet().getTilebmpFile()).toURI().toURL().toString();<br />
                            writer.format("\t\t\turl: \"%s\"\r\n", s);<br />
                            tileMap.put(ts, tileMap.size());<br />
                            writer.format("\t\t},\r\n");<br />
                        }<br />
                    }<br />
                }<br />
        }<br />
        writer.format("\t]\r\n&#8221;);</p>
<p>        ml = map.getLayers();<br />
        writer.format(&#8220;\tlayers: [\r\n");<br />
		while (ml.hasNext()) {<br />
			layer = (TileLayer)ml.next();<br />
            writer.format("\t\tTilelayer {\r\n");<br />
            writer.format("\t\t\tname: \"%s\"\r\n", layer.getName());<br />
            writer.format("\t\t\twidth: %d\r\n", layer.getWidth());<br />
            writer.format("\t\t\theight: %d\r\n", layer.getHeight());<br />
            writer.format("\t\t\tvisible: %s\r\n", layer.isVisible());<br />
            writer.format("\t\t\ttiles: [");<br />
            for (int y = 0; y &lt; layer.getHeight(); y++)<br />
                for (int x = 0; x &lt; layer.getWidth(); x++)<br />
                    if (layer.getTileAt(x, y)!=null)<br />
                        writer.format("%d,", layer.getTileAt(x, y).getId() );<br />
                    else<br />
                        writer.format("-1,");<br />
            writer.format("]\r\n&#8221;);<br />
            writer.format(&#8220;\t\t\timages: [");<br />
            for (int y = 0; y &lt; layer.getHeight(); y++)<br />
                for (int x = 0; x  - 1) {<br />
                            var imgIndex = layer.tileImage(col, row);<br />
                            var imageTilesPerRow = (images[imgIndex].width / tileWidth) as Integer;<br />
                            insert<br />
                            ImageView {<br />
                                image: images[imgIndex];<br />
                                x: col * tileWidth<br />
                                y: row * tileHeight<br />
                                viewport: Rectangle2D {<br />
                                    minX: ( tileValue mod imageTilesPerRow ) * tileWidth<br />
                                    minY: ( tileValue / imageTilesPerRow ) * tileHeight<br />
                                    height: tileWidth,<br />
                                    width: tileHeight<br />
                                }<br />
                            }<br />
                            into con;<br />
                        }<br />
                    }<br />
                }<br />
        }<br />
        return Group {<br />
            content: con;<br />
        };<br />
    }</p>
<p>}</p>
<p>public class Tilelayer {<br />
    public-init var name: String;<br />
    public-init var width: Integer = 10;<br />
    public-init var height: Integer =  10;<br />
    public-init var tiles: Integer[];<br />
    public-init var images: Integer[];<br />
    public-init var visible: Boolean;</p>
<p>    public function tileValue(x: Integer, y: Integer) : Integer {<br />
        return tiles[x + (y * width) ];<br />
    }</p>
<p>    public function tileImage(x: Integer, y: Integer) : Integer {<br />
        return images[x + (y * width) ];<br />
    }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tama</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3708</link>
		<dc:creator>Tama</dc:creator>
		<pubDate>Sat, 25 Apr 2009 00:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3708</guid>
		<description>where i can get sdk javaFX for linux ?help me ..
Confirm to my email please</description>
		<content:encoded><![CDATA[<p>where i can get sdk javaFX for linux ?help me ..<br />
Confirm to my email please</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Silveira Neto</title>
		<link>http://silveiraneto.net/2009/01/11/game-map-edition-using-tiled/comment-page-1/#comment-3704</link>
		<dc:creator>Silveira Neto</dc:creator>
		<pubDate>Thu, 23 Apr 2009 17:18:48 +0000</pubDate>
		<guid isPermaLink="false">http://silveiraneto.net/?p=2085#comment-3704</guid>
		<description>@Marcelo poxa que legal, onde está o código?</description>
		<content:encoded><![CDATA[<p>@Marcelo poxa que legal, onde está o código?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
