AS3 Game Object Editor
Current version: 1.3.1
A few days Photo Storm posted a game dev tip on his site: Configure your games in real time. It seemed like a pretty good tip, especially if you're making a physics enabled game and you spend your time tweaking weight, restitution, and bouncability and the like. The images over on his site give a good idea on what you can do with an in-game editor. The only problem I have with this is that each panel seems to be custom-built for each level/game. As Terry Pratchett would say: blow that for a game of soldiers.
So, with the anticipation no doubt keeping you on the edge of your seat, I present the AS3 Game Object Editor:
Using the power of reflection and the ability to ignore my girlfriend for the weekend, the editor can make any class editable by adding a few lines of metadata. Once that's done and your class is registered, anytime an Object of that type is created and added to the Stage (non-DisplayObject objects, or blitted objects - if you're using something like Flixel - can be explicitly added by calling
registerObject()), it's added into the list of Objects that we can edit. Make your adjustments, and when you're finished, save out an XML file containing all your changes.
I've created a project for it on Bitbucket (it's released under the MIT license), you can read more about it from the links on the left, check out the documentation, or play with the prototype just below.
Thanks go out to Photon Storm for the intial idea and to Keith Peters at Bit-101 for the excellent Minimal Comps lib that the game editor uses to create the UI.
With the update comes some bug fixes, the ability to retrieve the current object that you're editing, and the ability to work with non-DisplayObject objects.
With the update comes the ability to highlight and track the current object (to make it easier to see which object you're editing if there's a lot of them), and the ability to click to select as the current object (
With the update comes some bug fixes, some refactoring, and the ability for objects to be removed from the Editor when they're removed from the Stage, or to explicitly remove them. ComboBox static const edits are now sorted for convenience as well.
Fixed bug where the available component array was getting repeatedly set which would throw the player into an infinite loop if using minimalcomps v0.9.10. There's still a bug in that lib that prevents me from using it though.