How do I change the icon for my HaxeFlixel project?

Overview

It’s quite simple to swap out the icon for your haxeflixel project. Supposing you already have a project created, there are two main steps:
1. Create a new icon and export it as a SVG file.
2. Update your Project.xml file

Step One – Create a SVG file

An SVG file is used to save vector art – something that can, essentially, be scaled in any direction infinitely without losing it’s clarity. This is especially important for icons, that may needed in various sizes, especially on Android.

Because I love open-source technology, I chose to create my dinky Face Defender game logo using InkScape. Load it up and make your logo!

Once you’re done, save it as icon.svg and put it in your projects assets/images folder.

Step Two – Update your project.xml file

This part’s easy. Add the following to your project.xml file:

<icon path="assets/icon.svg"/>

That’s it! Build and test with “lime test Android” and see the icon difference. Haxe uses built in tools to scale the svg file appropriately and encode as a png file.



Share this post


facebooktwittergoogle_plusredditpinterestlinkedinmail

Tags: , ,

One Response to “How do I change the icon for my HaxeFlixel project?”

  1. james t Says:

    I also noticed a bug in the version I was doing this on where if you had an svg and pngs in your xml file – it would always use the svg. Not sure if you noticed but perhaps something to look out for.

Leave a Reply