I’m currently working on an Adobe Edge job, it’s almost totally vector based, and it turned out there were few quick options for breaking Illustrator files down into multiple SVG files. After looking around, I decided to add features to Matthew Ericson’s awesome exporter script. Adding the SVG export format was easy enough, unfortunately I ran into another problem. The original tool was built for raster outputs, and whilst it did support EPS, each EPS file that was generated actually had all layers included (all invisible except one). So after some reworking I got it to generate small vector SVG/EPS [...]
Published at: 11:02 am - Thursday February 28 2013
Over the last few years XML has become a very unfashionable standard and especially in the Haxe world has drawn a lot of fire for being too verbose and containing too much redundancy. I still use XML when I feel it’s appropriate, and I wanted to explain why. When is XML the wrong choice? In the past, XML has been used as a way of serialising data as input for a known web application (either from the back-end or from a file). I see this as a misuse of the technology. If it is not a public service, it has [...]
Haxe is a great platform for future-proofing your work, and with NME it provides a solid tool-chain for cross-platform native development. Unfortunately, it lacks a real solution for the issue of user interfaces. That’s why I’ve been building Guise, a UI library for native and non-native user interfaces. Ideally, Haxe should have a UI system that does the following: Should be able to be dropped in quickly and easily, with little setup code. Allows the use of native controls where desired. Allows the developer to switch to non-native (i.e. drawn) controls when the design requires. Future display libraries should be [...]
Published at: 12:02 pm - Saturday February 16 2013
When working with XML files, it’s often convenient to break the data structure down into smaller parts, each saved within a separate file. There is a standard called XInclude which allows XML sources to reference other XML sources which can help reassemble your separate files into one structure. As part of my XML Tools library, I’ve implemented an XInclude system which takes in a root XML file, loads in any referenced XML files and returns the complete XML structure. Note: I’m well aware that XML has become the whipping boy of the web-dev world, but despite it’s verbosity we still [...]
I recently needed to navigate some XML in Haxe and noticed that there were few options for doing this quickly and easily in Haxe. I did notice Oleg’s Walker class which brings some of the E4X functionality of AS3 to Haxe. While the resulting code was more elegant than hand-writing loops and tests, it still felt too verbose, and I decided to add some macro sugar to it to cut down the syntax (and bring it closer in line with the E4X spec). The result is the E4X class, which reduces the amount of code by 2-3 times (in comparison [...]
Published at: 12:12 pm - Thursday December 27 2012
On a recent job I was tasked with creating a visually elegant replacement for an image out of some text (when an image was unavailable). I decided to adjust the font-size of each line of text in a block to fill a box. The result is the TextBoxTest class. To use it, you create a text field, set it’s properties (text/size/multiline etc), then send it to the TextFitter class like this: 12345var field:TextField = new TextField(); field.text = "THIS IS SOME DEMO TEXT."; field.width = field.height = 50; field.multiline = field.wordWrap = true; TextFitter.fit(field); The second parameter is ‘defaultSize’, this [...]
After finally settling on msignals as the event system used in my libraries, I turned my attention to cutting down the amount of code required to use it. To minimise the memory overhead (and dispatching performance) of signals, I prefer to use lazy instantiation. But this can make the implementation a bit verbose. Hence my lazy instantiation macro, it only cuts out 3 lines per signal, but makes the code considerably more legible.
In my spare time I’ve been working on a game for mobile. It’s based on Haxe/NME and Nape Physics. In this demo you can also catch a tiny glimpse of my upcoming GUI library (using the Chutzpah skin by Morgan Allan Knutson).
Click flash to focus, Arrows to move
Following some pretty good feedback on Composure, the composition library for Haxe, I decided to get some code documentation published. The result was a batch file which would generate documentation in Markdown format, which can then be manually committed and pushed to the github wiki. You can check out some examples of the results here, here & here. The Documentation system I wanted to have something generated directly from the code, and I had a preference for having it hosted within the Github Wiki system (for the simplicity of having code and docs accessible from the same place). When a [...]
Over the years I have realised that inheritance is massively overused by developers, and that by replacing it with a solid composition design, a lot of code becomes a lot more reusable. Some languages and platforms have native support for composition (e.g. Unity3D), but for the languages I use there was nothing, so about two years ago I built a lightweight composition framework for AS3 called Composure, I’ve recently completely rebuilt it for Haxe, utilising Haxe’s awesome typing and macro systems to make this small library really powerful.
I’ve just released a new Android App. It allows you to watch out-of-copyright videos from the Internet Archive Database on your phone or tablet. It’s currently early days and it doesn’t really have any browse functionality yet, just search fields. An iOS version will be coming soon also.
In this flash app I built for Evolvex, users can assemble furniture from different components in a 3D environment. When finished the furniture can be purchased, all of the components, along with a diagram of the furniture gets sent to the user.
Published at: 11:10 am - Wednesday October 06 2010
This is a microsite I built for Nokia with the great group at JWT. I built the physics portion of the site, all of the items and navigation moving around in the background using Box2D. I also built several of the pages.
As a language, I like CSS, it has a simple elegance that achieves it’s humble goals very nicely. It’s these humble goals that bother me. HTML is an XML based language, and fundamentally, all CSS is doing is targeting nodes within this XML and modifying their attributes. Of course, it’s not possible to, for example, modify the href property in an anchor tag, and this shows that the implementation of CSS is stifled by it’s modest goals. Also, CSS’ ever-growing list of selectors shows a fundamental inflexibility in it’s syntax. Selectors basically target specific nodes within your HTML, this sounds [...]
Grant Skinner, the renowned ActionScript developer, has recently been playing with applications that span both desktop computers and Android based smart-phones. An idea struck me that this dual-platform would be perfect for a environmental controlling system. Imagine, having installed a simple Remote Control app onto your phone, every time you walk into a hotspot certain controls can be sent onto your handset to give you control over certain systems around you.
When I first began programming I was appalled at the simplistic nature of the tools being used to create software; and whilst there have been admiral efforts in the past to make programming a more intuitive affair (think node-based programming) very few of these tools have lived on. In my opinion, this is symptomatic of a bigger problem in the way we build software; namely, the strong tethering between programming language, compiler & delivery platform. Imagine a system where, when you typed (in your preferred language), and behind-the-scenes, your IDE was converting all of your code into an XML based representation of [...]
Here is an application I built for Russell Investment during my time at the Farm. It allows customers to work out the best way they can distribute their contributions to maximise their returns. It presented some interesting challenges like building an efficient Data-Grid, and formatting text as it is typed by users (I got to finally use a diff formula). Check out the app here.