<?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>Dion Amago</title>
	<atom:link href="http://dionamago.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://dionamago.net</link>
	<description></description>
	<lastBuildDate>Mon, 03 Sep 2012 21:12:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Flash and HTML5 Canvas sprite sheets.</title>
		<link>http://dionamago.net/?p=512</link>
		<comments>http://dionamago.net/?p=512#comments</comments>
		<pubDate>Thu, 06 Oct 2011 04:56:20 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=512</guid>
		<description><![CDATA[A new hydrax demo showing flash and canvas identical: sprite sheets sprite sheet bodies (sets of sprite sheets with states and actions) box2d Check it out]]></description>
				<content:encoded><![CDATA[<p>A new <a href="https://github.com/dionjwa/hydrax">hydrax</a> <a href="http://dionamago.net/content/demos/animatedbody/index.xhtml">demo</a> showing flash and canvas identical:</p>

<ul>
<li>sprite sheets</li>
<li>sprite sheet bodies (sets of sprite sheets with states and actions)</li>
<li>box2d</li>
</ul>

<p><a href="http://dionamago.net/content/demos/animatedbody/index.xhtml">Check it out</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=512</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Method chaining, Haxe &#8216;using&#8217;, and PBE/Hydrax components</title>
		<link>http://dionamago.net/?p=504</link>
		<comments>http://dionamago.net/?p=504#comments</comments>
		<pubDate>Mon, 12 Sep 2011 17:23:11 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=504</guid>
		<description><![CDATA[The &#8220;using&#8221; mixin in Haxe is one of those rare features that add usability without sacrificing flexibility. Combined with the component-based architecture of the Pushbutton Engine/Hydrax, you can write code for the Hydrax game engine that is short, readable, powerful, &#8230; <a href="http://dionamago.net/?p=504">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The &#8220;<a href="http://haxe.org/manual/using">using</a>&#8221; mixin in <a href="http://haxe.org">Haxe</a> is one of those rare features that add usability without sacrificing flexibility.  Combined with the component-based architecture of the <a href="http://pushbuttonengine.com">Pushbutton Engine</a>/<a href="https://github.com/dionjwa/hydrax">Hydrax</a>, you can write code for the Hydrax game engine that is short, readable, powerful, and extremely flexible and customizable.  </p>

<p>In a nutshell, you use &#8220;using&#8221; to inject methods to an IEntity object that allow behavior to be dynamically added, with the option of chaining the methods.  The statically injected methods add components to the entity where needed.</p>

<p><a href="http://pushbuttonengine.com/docs/04-Components.html">Read here to learn about Pushbutton Engine components</a>.</p>

<p>Let&#8217;s dive in with an example, and explain as we go along.</p>

<h4>Building a button</h4>

<p>Assume you are in the <strong>setup()</strong> method of an IPBContext instance.  You&#8217;ll need to import (using import) the following:</p>

<pre><code>using com.pblabs.components.input.InputTools;
using com.pblabs.components.scene2D.ImageTools;
using com.pblabs.components.scene2D.SceneUtil;
using com.pblabs.components.input.InputTools;
using com.pblabs.engine.util.PBUtil;
</code></pre>

<p>You&#8217;ll need a SceneLayer to add the button to:</p>

<pre><code>var scene = addSingletonComponent(SceneUtil.MANAGER_CLASS);
scene.sceneAlignment = SceneAlignment.TOP_LEFT;
var layer :BaseSceneLayer&lt;Dynamic, Dynamic&gt; = scene.addLayer();
</code></pre>

<p>Then create the button like so:</p>

<pre><code>var button = createBaseSceneEntity()
    .addSvg(layer, Resources.list.TITLEBAR, [new SvgReplace("$T", "The Title")])
    .makeReactiveButton()
    .initializeEntity("titlebar")
    .setSceneAlignment(SceneAlignment.CENTER);
</code></pre>

<p>Let&#8217;s go through it.  Firstly, all of the above chained methods are static methods defined in one of the using classes.  Except for the first call that creates the <strong>IEntity</strong> object and the <strong>initializeEntity</strong> call, all the calls follow a similar pattern:</p>

<ol>
<li>Check if the component needed for the required functionality is present.</li>
<li>If the component is missing, add it.</li>
<li>Add the functionality, data, behavior, or whatever.</li>
</ol>

<p>A (hopefully) clear example is the <strong>makeReactiveButton</strong> call:</p>

<pre><code>public static function makeReactiveButton (e :IEntity) :IEntity
{
    ensureMouseInputComponent(e);
    var mouse = e.getComponent(MouseInputComponent);
    makeReactiveButtonInternal(mouse);
    return e;
}
</code></pre>

<p>Given an IEntity, it ensures that a MouseInputComponent is present, then adds the signal listeners that make the component respond visually to mouse/touch clicks.</p>

<p>The great thing about this is that you only have to import the using class.  The methods therein ensure that the appropriate components are added or set up correctly.  The IEntity/Component architecture of PBE/Hydrax allows you to add (or even remove) behavior at run time, without having to resort to building complicated and unwieldily class hierarchies.</p>

<p>This makes it very easy to swap out components for your own, or add any kind of behavior to your game objects in a clear and readable way.</p>

<p>Also, now your code libraries for building objects consist of mostly static calls.  This helps to prevent unnecessary dependencies and generally minimizes bugs as the methods are not tracking any state information.  </p>

<p>I hope this post was somewhat informative and readable.  Criticism and feedback welcome!</p>

<p>This post will be linked shortly to a concrete demo with source.</p>

<h3>Some links:</h3>

<ul>
<li>&#8220;using&#8221;

<ul>
<li><a href="http://scwn.net/2009/05/23/injecting-methods-into-haxe-classes-with-using/">http://scwn.net/2009/05/23/injecting-methods-into-haxe-classes-with-using/</a></li>
<li><a href="http://haxe.org/manual/using">Official haxe docs</a></li>
</ul></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=504</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bi-directional asynchronous Haxe remoting</title>
		<link>http://dionamago.net/?p=487</link>
		<comments>http://dionamago.net/?p=487#comments</comments>
		<pubDate>Sat, 23 Jul 2011 02:01:34 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[HaXe]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=487</guid>
		<description><![CDATA[HaXe remoting is an incredibly powerful and flexible tool. However, it&#8217;s missing asynchronous calls on the server. Two examples where you might need this: Flash javascript communication. For example, calling asynchronous javascript functions from Flash, such as when your Flash &#8230; <a href="http://dionamago.net/?p=487">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://haxe.org/doc/remoting/0_introduction">HaXe remoting</a> is an incredibly powerful and flexible tool. However, it&#8217;s missing asynchronous calls on the server.</p>

<p>Two examples where you might need this: </p>

<ul>
<li>Flash <-> javascript communication.  For example, calling asynchronous javascript functions from Flash, such as when your Flash game wants to make Facebook API calls from javascript (this is often better or faster than waiting to use the Flash Facebook API).</li>
<li>When Node.js is the remoting server.  Node.js is designed around asynchronous calls.  Having Node.js block until it finishes a potentially time-consuming remoting call defeats the purpose of using Node.js</li>
</ul>

<p>I&#8217;ve added some extra asynchronous remoting classes in <a href="https://github.com/dionjwa/hydrax">hydrax</a> that solves this problem.  I&#8217;ll go though an example to illustrate how the classes are used.  In this case, I&#8217;ll assume that the server is Node.js and the client is Flash or JS.</p>

<p>Firstly, we&#8217;ll define a &#8216;<em>service</em>&#8216; that the server is offering to the client.  It&#8217;s just an interface that defines the methods the client will call:</p>

<pre><code>interface RoomService
{
    function getRoomNumber (cb :Int-&gt;Void) :Void;
}
</code></pre>

<p>Note you are getting the result of this call from the callback function.</p>

<h3>On the client</h3>

<p>The client will implement RoomService via extending <em>haxe.remoting.BiAsyncProxy</em>:</p>

<pre><code>class RoomServiceProxy extends BiAsyncProxy, implements RoomService
{
    public function new (c :haxe.remoting.AsyncConnection)
    {
        super(c.resolve("roomservice"));
    }
}
</code></pre>

<p>Note that you <em>don&#8217;t</em> need to manually add in the methods from the RoomService interface: BiAsyncProxy does it for you!
Thanks to haxe macros: it examines RoomService interface, extracts all the functions, and adds them to the RoomServiceProxy class, similar to haxe.remoting.AsyncProxy.  It&#8217;s not strictly a <em>magic</em> class, but it works the same way.</p>

<h3>On the server</h3>

<pre><code>class RoomManager implements RoomService
{
    function getRoomNumber ( cb :Int-&gt;Void) :Void
    {
        //We'll assume the room number is 4.
        cb(4);
    }
}
</code></pre>

<p>Then, in the server initialization:</p>

<pre><code>var context = new Context();

var roomService = new RoomManager();
context.addObject("roomservice", roomService);

//Add the context to the html connection handler
var serviceHandler = new NodeJSHTMLConnection(context);
</code></pre>

<p><strong>That&#8217;s it!</strong></p>

<p>Now you have <strong>fully typed</strong> asynchronous calls on both the client and server, and the client and server code is completely separate (useful for untrusted client code).</p>

<h3>Asynchronous flash <-> javascript</h3>

<p>This works much the same way, except you need to use this class in Flash:</p>

<pre><code>... = haxe.remoting.ExternalAsyncConnection.jsConnect("async", context);
</code></pre>

<p>The Flash-js async remoting connection stores the calls in a hash, when the callback is returned from javascript, it returns the original hash id that called it.</p>

<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=487</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Node.js externs for HaXe</title>
		<link>http://dionamago.net/?p=447</link>
		<comments>http://dionamago.net/?p=447#comments</comments>
		<pubDate>Wed, 15 Jun 2011 21:15:00 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[HaXe]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=447</guid>
		<description><![CDATA[I&#8217;ve collected some Node.js externs for HaXe in a single collection point here.]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve collected some Node.js externs for HaXe in a single collection point <a href="http://lib.haxe.org/p/nodejs_externs">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=447</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-platform SVG user interfaces (and other game graphics).</title>
		<link>http://dionamago.net/?p=426</link>
		<comments>http://dionamago.net/?p=426#comments</comments>
		<pubDate>Sun, 15 May 2011 16:27:00 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[Flash/AS3]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[HaXe]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[hydrax]]></category>
		<category><![CDATA[PBE]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=426</guid>
		<description><![CDATA[Scalable Vector Graphics (svg) show great promise as building blocks for game graphics, but a useable cross-platform solution that actually uses the advantages of the svg format is currently lacking. In this post I&#8217;ll describe my solution implemented in haxe &#8230; <a href="http://dionamago.net/?p=426">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Scalable Vector Graphics (svg) show great promise as building blocks for game graphics, but a useable cross-platform solution that actually uses the advantages of the svg format is currently lacking.  In this post I&#8217;ll describe my solution implemented in haxe and the pushbutton engine port of hydrax.</p>

<p>The main advantanges of svgs are:</p>

<ol>
<li><strong>Scalability</strong>: whatever scale or resolution the platform (smartphones, desktopss) they always look sharp.</li>
<li><strong>Structure</strong>: vector graphics are composed of shapes, and these can be analysed and modified at runtime.  </li>
</ol>

<p>In Flash, one way to get svgs into your application or game is to embed the svg directly.  However, this converts the the svg into a DisplayObject with no access to the underlying elements.  I would like access to the svg elements to place UI elements, such as buttons, on some anchors, where the anchors are svg sub-elements.  This allows you to modify, re-use, or dynamically create your user interfaces without resorting to changing large numbers of files.  And I would like my UIs to look as similar as possible across multiple platforms/resolutions without having to change a ton of code.</p>

<p>So I&#8217;ve created an SVGComponent for Hydrax/Pushbutton.  This component is a SceneComponent with the following functionality:</p>

<ul>
<li>Accepts svg resources as <em>text</em>.  So you can simply embed or download svg files, either as haxe resources, or downloaded text files.  No more samhaxe.</li>
<li>Displays svgs in Flash using <a href="http://code.google.com/p/svgweb/">svgweb</a>.</li>
<li>Displays svgs in JS on the canvas element using <a href="http://code.google.com/p/canvg/">canvg</a> (thanks Gabe Lerner for being so resposive to bug fixes!).</li>
<li>Displays svgs natively in JS (as an alternative to the canvas).  This gives much better performance on iOs (compared to the HTML5 canvas).</li>
<li>Can be placed relative to a parent SVGComponent.  See below.</li>
</ul>

<p>Examples of simple UI showing 3 buttons automatically placed at anchor locations defined by another svg image.</p>

<ul>
<li><a href="http://dionamago.net/content/demos/svgui/flash/index.xhtml">Flash</a></li>
<li><a href="http://dionamago.net/content/demos/svgui/canvas/index.xhtml">Html5 Canvas</a></li>
<li><a href="http://dionamago.net/content/demos/svgui/css/index.xhtml">Html5 Css</a></li>
</ul>

<p>SVGComponents (or any SceneComponent) can be placed at the location of an svg anchor.  What is an &#8216;anchor&#8217;?  It is a svg rectangle labeled (in Inkscape) with the prefix &#8216;anchor&#8217;:</p>

<p><img height="308" style="margin: 5px" width="590" alt="" src="http://dionamago.net/content/demos/svgui/2011-05-15_inkscape-anchors.png" /></p>

<p>This label tells the HierarchyManager that other SceneComponents (like DisplayObjects in Flash) can be set as children, and they will be properly positioned.  SVG images can be set as sub-images in e.g. buttons, allowing the creation of buttons with icons, without having to create a whole new button. </p>

<p>This allows game developers to create UIs and other game graphics in open source tools like Inkscape and use the assets with no modification for all major web platforms.</p>

<p>The full source and example are available from the <a href="https://github.com/dionjwa/Hydrax">github repository</a> under demo/svgUI.</p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=426</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jEdit: Haxe switch enum completion.</title>
		<link>http://dionamago.net/?p=416</link>
		<comments>http://dionamago.net/?p=416#comments</comments>
		<pubDate>Sat, 15 Jan 2011 01:23:10 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[HaXe]]></category>
		<category><![CDATA[jEdit]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=416</guid>
		<description><![CDATA[I&#8217;ve just added this to the trunk of my Haxe jEdit plugin: autocompletion of switch statements from a chosen enum. Just type switch then hit the code-completion shortcut (⌘-space for me) and you&#8217;ll see the a list of enums: Select &#8230; <a href="http://dionamago.net/?p=416">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just added this to the trunk of my Haxe <a href="http://http://www.jedit.org">jEdit</a> plugin: autocompletion of <strong>switch</strong> statements from a chosen <strong>enum</strong>. Just type <strong>switch</strong> then hit the code-completion shortcut (⌘-space for me) and you&#8217;ll see the a list of enums:</p>

<p><img height="178" style="margin: 5px" width="311" alt="" src="http://dionamago.net/root/wp-content/uploads/2011/01/2011-01-14-screenshot011.png" /></p>

<p>Select an enum (or start typing to narrow choices) and hit enter on your chosen enum. A switch statement with all enum constructors is created.  SuperAbbrevs is applied to the insert, so hitting tab will cycle from the argument to all the cases:</p>

<p><img height="312" style="margin: 5px" width="192" alt="" src="http://dionamago.net/root/wp-content/uploads/2011/01/2011-01-14-screenshot02.png" /></p>

<p>I have to admit I quite enjoy adding code completion functions to the Haxe plugin.  Now that the pipeline is set up, it&#8217;s quite easy. This took about half an hour. I justified this because I&#8217;m writing a lot of game logic which means a lot of switch statements. Hopefully this will save me time in the long term.  </p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=416</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unified game engine demos for flash, HTML5 (and more)</title>
		<link>http://dionamago.net/?p=410</link>
		<comments>http://dionamago.net/?p=410#comments</comments>
		<pubDate>Thu, 25 Nov 2010 01:42:35 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[HaXe]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[hydrax]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=410</guid>
		<description><![CDATA[In my previous post, I outlined the benefits of a platform agnostic language and game engine. Here are some demos, showing basic sprite movement via scripts, and mouse/touch+gesture (iOS only sorry) input on a parallax enabled view: Flash Html5 Canvas &#8230; <a href="http://dionamago.net/?p=410">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In my <a href="http://dionamago.net/?p=386">previous post</a>, I outlined the benefits of a platform agnostic language and game engine.  Here are some demos, showing basic sprite movement via scripts, and mouse/touch+gesture (iOS only sorry) input on a parallax enabled view:  </p>

<ol>
<li><a href="http://dionamago.net/content/demos/panzoom/flash/index.xhtml">Flash</a></li>
<li><a href="http://dionamago.net/content/demos/panzoom/canvas/index.xhtml">Html5 Canvas</a></li>
<li><a href="http://dionamago.net/content/demos/panzoom/css/index.xhtml">Html5 Css</a></li>
</ol>

<p>There is no change in the game code in these demos.  The only differences are compiler switches, and the HTML page that embeds each of them.
I&#8217;m going to repeat for emphasis: there is <strong>no</strong> change in the code for device input (or anything else).  The mouse pans the parallax scene identically on flash, HTML5 canvas, and CSS transformed div and image elements.</p>

<p>Where needed, individual game components use platform specific methods that are aware of the target platform, but these are well isolated and are kept as low level as possible.  </p>

<p>As you can see, CSS transforms are pretty performant, and definitely better on iOs devices.  Touch screen phones and ipods etc have pretty good screens, meaning the canvas element has to be pretty large to fit the entire screen, which then runs like a dog.  By using CSS transforms, you can use static images or animate using mini canvas elements, and avoid having to redraw large swathes of the screen.</p>

<p>Other projects aimed at cross platform rendering copy the flash API for javascript (<a href="http://haxe.org/com/libs/jeash">Jeash</a>) and C++ (<a href="http://gamehaxe.com/2010/08/19/new-release/">NME</a>).  I think this is too much work and inflexible.  If you are going to make games, use a game engine, and make <em>that</em> platform agnostic.  Reimplementing the flash API is largely unnecessary and means that you have to write a lot of code to do a little, and you&#8217;ll also end up fitting all the resource loading, device input etc etc into the flash way, with the big assumption that it&#8217;s the best way.</p>

<p>If another platform came along tomorrow, the only classes to write anew would be a resource loading class, raw device input, and raw rendering (and sound).  The higher level stuff is all handled by haxe itself then the game engine on top of that.  It means as a developer, you are not chained to a particular platform, and can move to other platforms with relative ease.</p>

<p>Were these examples actual playable games, they are deployable almost anywhere:  desktop computers/laptops (flash, c++), android phones (flash), iOS devices (HTML5 stuff).  Did I mention Haxe compiles to multiple server-side languages as well?</p>

<p>It seems that the paradigm of <em>write once/run anwhere</em> is served better by a platform agnostic language, rather than a platform needs to be developed for all platforms.</p>

<p>The source for the engine and these demos are available <a href="https://github.com/dionjwa/Hydrax">here</a>.</p>

<p>If I can find a javascript frames-per-second counter, I&#8217;ll add them to the demos.</p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=410</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Markdown macro for jEdit.</title>
		<link>http://dionamago.net/?p=390</link>
		<comments>http://dionamago.net/?p=390#comments</comments>
		<pubDate>Sat, 20 Nov 2010 17:30:50 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[jEdit]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[jedit]]></category>
		<category><![CDATA[markdown]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=390</guid>
		<description><![CDATA[Markdown is a nice way to write blog type articles, providing a balance between readability and functionality. I flirted with dedicated blog editors, but as usual, fell back to my favourite editor, jEdit. Unfortunately, getting the markdown formatted post into &#8230; <a href="http://dionamago.net/?p=390">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><p><a href="http://daringfireball.net/projects/markdown">Markdown</a> is a nice way to write blog type articles, providing a balance between readability and functionality.  I flirted with dedicated blog editors, but as usual, fell back to my favourite editor, <a href="http://http://www.jedit.org">jEdit</a>.  Unfortunately, getting the markdown formatted post into the blog itself was cumbersome.  So, I wrote a beanshell macro that called a markdown shell command that copied the markdown->HTML formatted post into the clipboard.</p>

<p>Now my workflow is:</p><ol><li>Write blog in markdown.</li><li>Press keyboard shortcut bound to markdown macro.</li><li>Paste into blog.</li></ol><p>To do this, download the markdown perl script <a href="http://daringfireball.net/projects/markdown">here</a>.  Create a shell script called <strong>markdown</strong> that calls <strong>Markdown.pl</strong> with the first argument as a file and copies the results into the clipboard (Mac only sorry):</p>

<p>The <strong>markdown</strong> script:</p>

<p><code>#! /usr/bin/env sh</p>

<h1>Calls Markdown.pl on the file and copies the output to the clipboard.</h1>

<p>Markdown.pl --html4tags $1 | pbcopy
</code></p>

<p>Add the <strong>markdown</strong> script to your $PATH, and make it executable.</p>

<p>Then, in jEdit, create the macro:</p>

<p><code>runCommandInConsole(view,"System","markdown " + buffer.getPath());
</code></p>

<p>and save it as e.g. Markdown2Clipboard.bsh.  Now you can bind a shortcut to the macro, and it will apply the markdown converter on the current buffer in jEdit.  Then you can just paste the HTML into your blog.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=390</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pushbutton Engine and Haxe: a natural fit.</title>
		<link>http://dionamago.net/?p=386</link>
		<comments>http://dionamago.net/?p=386#comments</comments>
		<pubDate>Sat, 20 Nov 2010 14:27:00 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[Flash/AS3]]></category>
		<category><![CDATA[HaXe]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[hydrax]]></category>
		<category><![CDATA[PBE]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=386</guid>
		<description><![CDATA[The Pushbutton Engine is an actionscript modular game engine and framework. It solves several problems that arise after the beginning stages of game development: object bloat, complexity management, and code reusability. This means that after some time adding all the &#8230; <a href="http://dionamago.net/?p=386">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://pushbuttonengine.com/">The Pushbutton Engine</a> is an actionscript modular game engine and framework.  It solves several problems that arise after the beginning stages of game development: object bloat, complexity management, and code reusability.  This means that after some time adding all the behaviour needed by your game objects, e.g. a physics engine, controls, AI, rendering, sound etc, etc, it becomes more and more difficult to build code that is reusable, and managing object hierarchies becomes a giant pain.  The Pushbutton Engine (PBE) avoids this trap by the use of <em>components</em>.  The components defined in PBE communicate and integrate with one another via a a flexible system that avoids compile time dependencies, meaning that most of the time you can use someone else&#8217;s component without any modifications to the component source, and very little modification of your source (except of course the underlying game logic that uses that component).</p>

<p>A practical example.  Say you design a 2D top down game.  Later on, you decide that an isometric view is more suitable.  That could involve a single line of code change, or a single modification to a level XML file.  Unfortunately Pushbutton is written in actionscript (==Flash).</p>

<p>Step in HaXe.  HaXe allows you to write in one language and compile to many others (currently, Flash, php, javascript, C++, neko). Compiling for multiple platforms is a huge plus, allowing a developer to write in one language and deploy the game on multiple platforms.  Of course, deploying to multiple platforms means that certain low-level operations are unavoidably platform specific, notably loading resources, device input (mouse, touches, gestures, keyboard), and rendering.  There are moves to unify the rendering (<a href="http://haxe.org/com/libs/jeash">Jeash</a>, <a href="http://haxe.org/doc/start/cpp">NME</a>) so that the flash rendering API works on the HTML5/javascript and C++ platforms identically, but this may not be optimal in all cases.</p>

<p>The modular, component based archituecture of PBE is a natural fit to HaXe.  The platform specific parts can be written as components, allowing you to easily isolate these parts and swap them out depending on the platform.</p>

<p>So I&#8217;ve began porting PBE to Haxe.  The git repository is <a href="https://github.com/dionjwa/Hydrax">here</a>.  I&#8217;m endevouring to keep as close to the original architecture as possible, however often to make a class or component more general than AS3 means a significant rewrite.  At the very least, the core interfaces will be very similar if not the same.</p>

<p>In my <a href="http://dionamago.net/?p=410">next post</a> I&#8217;ve documented some examples of compilation to different platforms (Flash, javascript+css, and javascript+HTML5 canvas).</p>

<p>There are many other good reasons to use the Pushbutton Engine, I would encourage you to check out the <a href="http://pushbuttonengine.com/">website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=386</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Mozy and Carbonite Fail</title>
		<link>http://dionamago.net/?p=349</link>
		<comments>http://dionamago.net/?p=349#comments</comments>
		<pubDate>Mon, 18 Oct 2010 17:03:48 +0000</pubDate>
		<dc:creator>dionjwa</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dionamago.net/?p=349</guid>
		<description><![CDATA[I need a good offsite backup solution.  I tried Mozy, except the mac client chokes on &#8220;large&#8221; numbers of files, rendering my computer unusable for hours.  The client for Carbonite is buggy:  I could not choose any files to backup.  &#8230; <a href="http://dionamago.net/?p=349">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I need a good offsite backup solution.  I tried Mozy, except the mac client chokes on &#8220;large&#8221; numbers of files, rendering my computer unusable for hours.  The client for Carbonite is buggy:  I could not choose any files to backup.  I can&#8217;t believe the two top cloud backups services failed so utterly.</p>

<p>Update: reason why carbonite failed was because their client doesn&#8217;t work on hackintoshes!  That the first software I&#8217;ve encountered that doesn&#8217;t work on a hackintosh due to the need for mac hardware.  That&#8217;s quite lame Carbonite.  Why are you so failingly special?</p>
]]></content:encoded>
			<wfw:commentRss>http://dionamago.net/?feed=rss2&#038;p=349</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
