<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Silveira Neto &#187; pixel art</title>
	<atom:link href="http://silveiraneto.net/tag/pixel-art/feed/" rel="self" type="application/rss+xml" />
	<link>http://silveiraneto.net</link>
	<description>the world is a pixel</description>
	<lastBuildDate>Sun, 08 Jan 2012 05:17:57 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>bug invaders</title>
		<link>http://silveiraneto.net/2010/04/22/bug-invaders/</link>
		<comments>http://silveiraneto.net/2010/04/22/bug-invaders/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 16:33:48 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[português]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[arte]]></category>
		<category><![CDATA[Atlântico]]></category>
		<category><![CDATA[fikdik]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[Pixelart]]></category>
		<category><![CDATA[post-its]]></category>
		<category><![CDATA[SEMC]]></category>
		<category><![CDATA[space invaders]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=3334</guid>
		<description><![CDATA[Sem dúvida os post-its nos tornam mais ágeis e são indispensáveis para metodologias que fazem uso de dashboards como Scrum. Mas o que fazer com as toneladas de post-its que são gerados e descartados? E o impacto ambiental? E o meio ambiente? E as araras-azuis? Eis minha intervenção artística no escritório. Bug Invaders (sugestão de [...]]]></description>
			<content:encoded><![CDATA[<p>Sem dúvida os post-its nos tornam mais ágeis e são indispensáveis para metodologias que fazem uso de dashboards como Scrum. Mas o que fazer com as toneladas de post-its que são gerados e descartados? E o impacto ambiental? E o meio ambiente? E as araras-azuis?</p>
<p>Eis minha intervenção artística no escritório. Bug Invaders (sugestão de nome do Diego &#8220;Diegão&#8221; Andrade), nada mais justo já que umas das funcionalidades dos post-its é manter um rastro dos bugs e issues em aberto.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/silveiraneto/4543429800/"><img class="alignnone size-full wp-image-3333" title="space invader post-its" src="http://silveiraneto.net/wp-content/uploads/2010/04/space_invader_resize.jpg" alt="" width="600" height="353" /></a></p>
<ul>
<li>Lixo é ressignificado em arte (ao menos por um período antes de virar lixo outra vez).</li>
<li>Deixa o ambiente mais divertido.</li>
<li>Pixel art! Foram gastos 48 pixels.</li>
<li><a href="http://en.wikipedia.org/wiki/Space_Invaders">Nostalgia</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2010/04/22/bug-invaders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Openpixels &#8211; Chars</title>
		<link>http://silveiraneto.net/2009/12/23/openpixels-chars/</link>
		<comments>http://silveiraneto.net/2009/12/23/openpixels-chars/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 20:37:55 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[chars]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[Openpixels]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[Pixelart]]></category>
		<category><![CDATA[Santa Claus]]></category>
		<category><![CDATA[xmas]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=3077</guid>
		<description><![CDATA[Now I&#8217;m calling this set of free and open art for my and others games I draw just by Openpixels. And to celebrate this and Christmas, here&#8217;s a pixel art game style Santa Claus. I hope he bring a lot a pixels in his bag. Download: open_chars.xcf]]></description>
			<content:encoded><![CDATA[<p>Now I&#8217;m calling <a title="see them" href="http://silveiraneto.net/tag/pixelart">this set of free and open art</a> for my and others games I draw just by <strong>Openpixels</strong>. And to celebrate this and Christmas, here&#8217;s a pixel art game style Santa Claus. I hope he bring a lot a pixels in his bag.</p>
<p style="text-align: center;"><img class="size-full wp-image-3076 aligncenter" title="Santa Claus Pixel Art" src="http://silveiraneto.net/wp-content/uploads/2009/12/santa.png" alt="" width="210" height="420" /></p>
<p><strong>Download:</strong> <a href="http://silveiraneto.net/downloads/open_chars.xcf">open_chars.xcf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2009/12/23/openpixels-chars/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Free Tileset, version 9</title>
		<link>http://silveiraneto.net/2009/04/06/my-free-tileset-version-9/</link>
		<comments>http://silveiraneto.net/2009/04/06/my-free-tileset-version-9/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 13:27:26 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[chars]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[laboratory]]></category>
		<category><![CDATA[my free tileset]]></category>
		<category><![CDATA[myself]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[Pixelart]]></category>
		<category><![CDATA[tileset]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=2464</guid>
		<description><![CDATA[More scenes and tiles for the free and open pixelart tileset. Also new monsters and characters but these will be showed in more details in another post. Scientists discovery that they can&#8217;t keep a Gjelly (one of the new monsters) in cages. And also a little medieval scene. A naive princess got a Nhamnham monster [...]]]></description>
			<content:encoded><![CDATA[<p>More scenes and tiles for the free and open pixelart tileset. Also new monsters and characters but these will be showed in more details in another post.</p>
<p>Scientists discovery that they can&#8217;t keep a <em>Gjelly</em> (one of the new monsters) in cages.</p>
<p style="text-align: center;"><img class="size-full wp-image-2463 aligncenter" title="lab incident" src="http://silveiraneto.net/wp-content/uploads/2009/04/lab_incident.png" alt="lab incident" width="640" height="640" /></p>
<p>And also a little medieval scene. A naive princess got <a title="NhamNham" href="http://silveiraneto.net/2009/03/31/nhamnham/">a Nhamnham monster</a> as her pet.</p>
<p style="text-align: center;"><img class="size-full wp-image-2466 aligncenter" title="cena princessa nhamnham" src="http://silveiraneto.net/wp-content/uploads/2009/04/cena_princessa_nhamnham.png" alt="cena princessa nhamnham" width="640" height="640" /></p>
<p>A new village scene, now with a pier, water, fence and new chars.</p>
<p><img class="size-full wp-image-2467 aligncenter" title="cena pier pixelart" src="http://silveiraneto.net/wp-content/uploads/2009/04/cena_pier.png" alt="cena pier pixelart" width="640" height="640" /></p>
<p>There&#8217;s a plenty of new tiles. Now that we have a good basic tiles becomes easy to add more tiles.</p>
<p style="text-align: center;"><img class="size-full wp-image-2469 aligncenter" title="free_tileset_version_9" src="http://silveiraneto.net/wp-content/uploads/2009/04/free_tileset_version_9.png" alt="free_tileset_version_9" width="480" height="1088" /></p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2009/04/06/my-free-tileset-version-9/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>JavaFX, Simple Tile Set</title>
		<link>http://silveiraneto.net/2008/12/20/javafx-simple-tile-set/</link>
		<comments>http://silveiraneto.net/2008/12/20/javafx-simple-tile-set/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 19:23:57 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[jfx]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[openjfx]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[Tile Set]]></category>
		<category><![CDATA[tileset]]></category>
		<category><![CDATA[video game]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1951</guid>
		<description><![CDATA[Tile sets are a very simple way to draw scenarios with repeated elements. From simple to complex ones using a very low footprint. First step, load the png file that stores the tileset into a Image. The file tiles.png shoud be in the same directory of the source code. I adjusted some tiles from those [...]]]></description>
			<content:encoded><![CDATA[<p>Tile sets are a very simple way to draw scenarios with repeated elements. From simple to complex ones using a very low footprint.</p>
<p>First step, load the png file that stores the tileset into a <a title="JavaFX API" href="http://java.sun.com/javafx/1/docs/api/javafx.scene.image/javafx.scene.image.Image.html">Image</a>. The file tiles.png shoud be in the same directory of the source code. I adjusted some tiles from those tile set <a title="Tile set" href="http://silveiraneto.net/2008/08/31/my-free-tileset-version-2/">I&#8217;ve blogged here before</a> into a grid of 10&#215;10 tiles.</p>
<p style="text-align: center;"><img class="size-full wp-image-1955 aligncenter" title="Set of tiles, example" src="http://silveiraneto.net/wp-content/uploads/2008/12/tiles.png" alt="Set of tiles, example" width="320" height="320" /></p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">var tileset <span style="color: #339933;">=</span> <span style="color: #003399;">Image</span> <span style="color: #009900;">&#123;</span>
   url<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;{__DIR__}tiles.png&quot;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>Notice that each tile have 32 of height and 32 of width. We will assume this and use theses numbers when performing calculations to find a single tile in our tile set.</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">def w <span style="color: #339933;">=</span> <span style="color: #cc66cc;">32</span>;
def h <span style="color: #339933;">=</span> <span style="color: #cc66cc;">32</span>;</pre>
</div>
</div>
<p>To display a Image in the screen we use a <a title="JavaFX API" href="http://java.sun.com/javafx/1/docs/api/javafx.scene.image/javafx.scene.image.ImageView.html">ImageView</a> node. A ImageView can have a viewport property to create crop or zoom effect. A viewport is just a <a href="http://java.sun.com/javafx/1/docs/api/javafx.geometry/javafx.geometry.Rectangle2D.html">Rectangle2D</a>, a object with position (minX and minY), height and width. If we want to display the first tile in the tileset we do</p>
<p style="text-align: center;"><img class="size-full wp-image-1956 aligncenter" title="first tile" src="http://silveiraneto.net/wp-content/uploads/2008/12/first_tile.png" alt="first tile" width="32" height="32" /></p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">ImageView <span style="color: #009900;">&#123;</span>
   image<span style="color: #339933;">:</span> tileset
   viewport<span style="color: #339933;">:</span> <span style="color: #003399;">Rectangle2D</span><span style="color: #009900;">&#123;</span>
      minX<span style="color: #339933;">:</span> 0, minY<span style="color: #339933;">:</span> 0, height<span style="color: #339933;">:</span> <span style="color: #cc66cc;">32</span>, width<span style="color: #339933;">:</span> <span style="color: #cc66cc;">32</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>Notice that the minX determines the column and minY the row in the tileset. The first row is 0*32, the second row is 1*32 and so on. If we want to display the tile at the second line and third column of the tileset we do</p>
<p style="text-align: center;"><img class="size-full wp-image-1957 aligncenter" title="another_tile" src="http://silveiraneto.net/wp-content/uploads/2008/12/another_tile.png" alt="another_tile" width="32" height="32" /></p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">ImageView <span style="color: #009900;">&#123;</span>
   image<span style="color: #339933;">:</span> tileset
   viewport<span style="color: #339933;">:</span> <span style="color: #003399;">Rectangle2D</span><span style="color: #009900;">&#123;</span>
      minX<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">32</span> , minY<span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">32</span>, height<span style="color: #339933;">:</span> <span style="color: #cc66cc;">32</span>, width<span style="color: #339933;">:</span> <span style="color: #cc66cc;">32</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>Those properties in a Rectangle2D are for init and read only. So I created a list with all Rectangles I can need for use as a viewport.</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">def viewports <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>row in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>col in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #003399;">Rectangle2D</span><span style="color: #009900;">&#123;</span>
           minX<span style="color: #339933;">:</span> col <span style="color: #339933;">*</span> w, minY<span style="color: #339933;">:</span> row <span style="color: #339933;">*</span> h, height<span style="color: #339933;">:</span> w, width<span style="color: #339933;">:</span> h
       <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>The scenario map is stored in another list. The first element of the list is 7, that is, the first tile in the scenario is the 7th tile from the tile set.</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">var map <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
    <span style="color: #cc66cc;">7</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">8</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">26</span>, <span style="color: #cc66cc;">40</span>, <span style="color: #cc66cc;">41</span>, <span style="color: #cc66cc;">24</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">23</span>, <span style="color: #cc66cc;">24</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">36</span>, <span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">51</span>, <span style="color: #cc66cc;">34</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">34</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">25</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">57</span>, <span style="color: #cc66cc;">58</span>, <span style="color: #cc66cc;">44</span>, <span style="color: #cc66cc;">45</span>, <span style="color: #cc66cc;">46</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">35</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">27</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">55</span>, <span style="color: #cc66cc;">56</span>,  <span style="color: #cc66cc;">5</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">38</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">16</span>, <span style="color: #cc66cc;">47</span>, <span style="color: #cc66cc;">48</span>, <span style="color: #cc66cc;">15</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">61</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">70</span>,  <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">33</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">71</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">49</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">17</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>, <span style="color: #cc66cc;">18</span>,
<span style="color: #009900;">&#93;</span>;</pre>
</div>
</div>
<p>Finally to create a scenario with 100 tiles, 10 per row and with 10 rows, in a list called <em>tiles</em>. Each iteration of this loop creates a <em>ImageView</em>. Each <em>ImageView</em> will store a single tile. We get the tile number in the <em>map</em> list and so use it to index the <em>viewports</em> list.</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">var tiles <span style="color: #339933;">=</span>  <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>row in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>col in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      ImageView <span style="color: #009900;">&#123;</span>
         x<span style="color: #339933;">:</span> col <span style="color: #339933;">*</span> w, y<span style="color: #339933;">:</span> row <span style="color: #339933;">*</span> h,
         viewport<span style="color: #339933;">:</span> bind viewports<span style="color: #009900;">&#91;</span>map<span style="color: #009900;">&#91;</span>row <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> col<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span>
         image<span style="color: #339933;">:</span> tileset
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>Additionally I added two things to transform this program also in a (extremely)  simple map editor. At each <em>ImageView</em> I added a callback for <em>onMouseClicked</em> event. When you click on a tile, it changes its <em>map</em> position, ie, the tile. The next tile for the left button and the last tile for any other button.</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">onMouseClicked<span style="color: #339933;">:</span> function<span style="color: #009900;">&#40;</span> e<span style="color: #339933;">:</span> <span style="color: #003399;">MouseEvent</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #003399;">Void</span> <span style="color: #009900;">&#123;</span>
   var amount <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">button</span> <span style="color: #339933;">==</span> MouseButton.<span style="color: #006633;">PRIMARY</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#125;</span>;
   map<span style="color: #009900;">&#91;</span>row <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>map<span style="color: #009900;">&#91;</span>row <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> amount<span style="color: #009900;">&#41;</span> mod <span style="color: #cc66cc;">100</span>;
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>The other thing is to print the <em>map</em> list when the program is over. There is the full program:</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tileeditor</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.stage.Stage</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.Scene</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.image.ImageView</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.image.Image</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.CustomNode</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.Group</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.Node</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.geometry.Rectangle2D</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.input.MouseEvent</span>;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.scene.input.MouseButton</span>;
&nbsp;
def w <span style="color: #339933;">=</span> <span style="color: #cc66cc;">32</span>;
def h <span style="color: #339933;">=</span> <span style="color: #cc66cc;">32</span>;
&nbsp;
var map <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
    <span style="color: #cc66cc;">7</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">8</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">26</span>, <span style="color: #cc66cc;">40</span>, <span style="color: #cc66cc;">41</span>, <span style="color: #cc66cc;">24</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">23</span>, <span style="color: #cc66cc;">24</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">36</span>, <span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">51</span>, <span style="color: #cc66cc;">34</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">34</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">25</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">57</span>, <span style="color: #cc66cc;">58</span>, <span style="color: #cc66cc;">44</span>, <span style="color: #cc66cc;">45</span>, <span style="color: #cc66cc;">46</span>,  <span style="color: #cc66cc;">2</span>,  <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">35</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">27</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">55</span>, <span style="color: #cc66cc;">56</span>,  <span style="color: #cc66cc;">5</span>,  <span style="color: #cc66cc;">3</span>,  <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">38</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">16</span>, <span style="color: #cc66cc;">47</span>, <span style="color: #cc66cc;">48</span>, <span style="color: #cc66cc;">15</span>, <span style="color: #cc66cc;">13</span>, <span style="color: #cc66cc;">61</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">70</span>,  <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">33</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">71</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">19</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>,  <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">49</span>, <span style="color: #cc66cc;">19</span>,
   <span style="color: #cc66cc;">17</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>,  <span style="color: #cc66cc;">9</span>, <span style="color: #cc66cc;">18</span>,
<span style="color: #009900;">&#93;</span>;
&nbsp;
var tileset <span style="color: #339933;">=</span> <span style="color: #003399;">Image</span> <span style="color: #009900;">&#123;</span>
    url<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;{__DIR__}tiles.png&quot;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
def viewports <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>row in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>col in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #003399;">Rectangle2D</span><span style="color: #009900;">&#123;</span>
           minX<span style="color: #339933;">:</span> col <span style="color: #339933;">*</span> w, minY<span style="color: #339933;">:</span> row <span style="color: #339933;">*</span> h, height<span style="color: #339933;">:</span> w, width<span style="color: #339933;">:</span> h
       <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
var tiles <span style="color: #339933;">=</span>  <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>row in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>col in <span style="color: #009900;">&#91;</span>0..9<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      ImageView <span style="color: #009900;">&#123;</span>
         x<span style="color: #339933;">:</span> col <span style="color: #339933;">*</span> w, y<span style="color: #339933;">:</span> row <span style="color: #339933;">*</span> h,
         viewport<span style="color: #339933;">:</span> bind viewports<span style="color: #009900;">&#91;</span>map<span style="color: #009900;">&#91;</span>row <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> col<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span>
         image<span style="color: #339933;">:</span> tileset
&nbsp;
         onMouseClicked<span style="color: #339933;">:</span> function<span style="color: #009900;">&#40;</span> e<span style="color: #339933;">:</span> <span style="color: #003399;">MouseEvent</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #003399;">Void</span> <span style="color: #009900;">&#123;</span>
            var amount <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">button</span> <span style="color: #339933;">==</span> MouseButton.<span style="color: #006633;">PRIMARY</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#125;</span>;
            map<span style="color: #009900;">&#91;</span>row <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>map<span style="color: #009900;">&#91;</span>row <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> amount<span style="color: #009900;">&#41;</span> mod <span style="color: #cc66cc;">100</span>;
         <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
Stage <span style="color: #009900;">&#123;</span>
    title<span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;JavaFX Simple Tile Editor&quot;</span>
    scene<span style="color: #339933;">:</span> Scene <span style="color: #009900;">&#123;</span>
        content<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> tiles <span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span>
    onClose<span style="color: #339933;">:</span> function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        println<span style="color: #009900;">&#40;</span>map<span style="color: #009900;">&#41;</span>;
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>Here is the result for that<em> map</em></p>
<p style="text-align: center;"><img class="size-full wp-image-1961 aligncenter" title="tlemap javafx" src="http://silveiraneto.net/wp-content/uploads/2008/12/tilemap_javafx.png" alt="tlemap javafx" width="320" height="320" /></p>
<p>And you can try it yourself in your browser.<strong> <a title="Simple Tile Editor Online" href="http://silveiraneto.net/downloads/SimpleTileEditor/dist/JavaFxSandBox.html">Play it online now</a></strong>.</p>
<p>Here is a video of it working</p>
<p style="text-align: center;"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/lxuBEoItB5E&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/lxuBEoItB5E&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></object></p>
<p><strong>Downloads:</strong></p>
<ul>
<li>Complete source code and project in NetBeans, <a title="Simple Tile Editor" href="http://silveiraneto.net/downloads/SimpleTileEditor.tar.bz2">SimpleTileEditor.tar.bz2</a>.</li>
<li>Video of it working, <a title="OGG Video" href="http://silveiraneto.net/downloads/javafx_tile_set.ogv">javafx_tile_set.ogv</a>.</li>
<li>Program main class, <a title="Main class" href="http://silveiraneto.net/downloads/SimpleTileEditor/src/tileeditor/Main.fx">Main.fx</a>.</li>
</ul>
<p><strong>Possibilities</strong></p>
<p>We are using just  a image that can handle 100 tiles, <a href="ttp://silveiraneto.net/wp-content/uploads/2008/12/tiles.png">tiles.png</a> with less than 30Kb. The map is also composed with 100 tiles. Each tile we can choose between 100 different tiles, so we can compose 10<sup>100</sup> different maps (one <a title="Wikipedia, english" href="http://en.wikipedia.org/wiki/Googol">googol</a><sup>10</sup> ). Most of them are useless and without any sense, but some are cool. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/12/20/javafx-simple-tile-set/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Free Tileset, version 3</title>
		<link>http://silveiraneto.net/2008/12/01/my-free-tileset-version-3/</link>
		<comments>http://silveiraneto.net/2008/12/01/my-free-tileset-version-3/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 01:17:34 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[Pixel]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[Pixelart]]></category>
		<category><![CDATA[tileset]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1818</guid>
		<description><![CDATA[Changelog since the last version: I noticed that I had released another free tileset before with a different aesthetic approach. For now I&#8217;m merging it with the &#8220;My Free Tileset&#8221;. With them is possible to do things like this: Added a door. I&#8217;m trying to find a good style for outside building for this set. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1819 aligncenter" title="silveira_neto_gpl_pixelart_tilese_version_3" src="http://silveiraneto.net/wp-content/uploads/2008/12/silveira_neto_gpl_pixelart_tilese_version_3.png" alt="" width="400" height="658" /></p>
<p>Changelog since the last version:</p>
<ol>
<li>I noticed that I had released <a title="Another Free Tileset" href="http://silveiraneto.net/2008/04/27/simple-java-tileset-example/">another free tileset before</a> with a different aesthetic approach. For now I&#8217;m merging it with the &#8220;My Free Tileset&#8221;. With them is possible to do things like this:</li>
<p style="text-align: center;"><img src="http://silveiraneto.net/wp-content/uploads/2008/04/tileset_game_java_screenshot.png" alt="Example" /></p>
<li>Added a door.</li>
</ol>
<p>I&#8217;m trying to find a good style for outside building for this set. I tried some kinds of roofs but they are not good yet.</p>
<p style="text-align: center;"><img class="size-full wp-image-1826 aligncenter" title="pixelart_outdoor_tileset" src="http://silveiraneto.net/wp-content/uploads/2008/12/pixelart_outdoor_tileset1.png" alt="" width="400" height="320" /></p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/12/01/my-free-tileset-version-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Free Tileset, version 2</title>
		<link>http://silveiraneto.net/2008/08/31/my-free-tileset-version-2/</link>
		<comments>http://silveiraneto.net/2008/08/31/my-free-tileset-version-2/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 16:01:10 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[artwork]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[Pixel]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[Pixelart]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[tileset]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1188</guid>
		<description><![CDATA[Second version of the my free tileset. Now is possible to build a entire house. :-) Here is the tileset. There&#8217;s a nice map editor with several features called Tiled. If you are edditing game maps, take a look.]]></description>
			<content:encoded><![CDATA[<p>Second version of the <a title="first version" href="http://silveiraneto.net/2008/08/30/my-free-tileset-version-1/">my free tileset</a>. Now is possible to build a entire house. :-)</p>
<p style="text-align: center;"><img class="size-full wp-image-1190 aligncenter" title="House pixelart free GPL" src="http://silveiraneto.net/wp-content/uploads/2008/08/silveira_neto_gpl_pixelart_kitchen_home1.png" alt="" width="416" height="384" /></p>
<p>Here is the tileset.</p>
<p style="text-align: center;"><img class="aligncenter" title="GPL Tileset pixel art version 2" src="http://silveiraneto.net/wp-content/uploads/2008/08/silveira_neto_gpl_pixelart_tilese_version_2.png" alt="" /></p>
<p style="text-align: center;"><a href="http://silveiraneto.net/wp-content/uploads/2008/08/silveira_neto_gpl_pixelart_kitchen_home1.png"><br />
</a></p>
<p>There&#8217;s a nice map editor with several features called <a href="http://www.mapeditor.org/">Tiled</a>. If you are edditing game maps, take a look.</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/08/31/my-free-tileset-version-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

