change readme to reflect file format change

This commit is contained in:
Jeremy Penner 2011-04-01 10:39:22 -07:00
parent 7a684c14bc
commit 550077d6d2

View file

@ -1,12 +1,12 @@
# KlikPunk # # KlikPunk #
_by Jeremy Penner_ _by Jeremy Penner_
KlikPunk is a tool for quickly composing "scenes" for games. You simply drag graphics from the bin at the left to the stage in the middle, arrange them as you please, and click the save icon to store a friendly XML file, ready for importing directly into your game. KlikPunk is a tool for quickly composing "scenes" for games. You simply drag graphics from the bin at the left to the stage in the middle, arrange them as you please, and click the save icon to store a friendly JSON file, ready for importing directly into your game.
### Creating a new scene ### ### Creating a new scene ###
When you start up KlikPunk, you are taken to a menu with two options: "New Stage", and "Open Stage". Click "New Stage", and you are presented with a save dialog. Navigate to the folder that you intend to store your stages in, and give your new stage a name. When you start up KlikPunk, you are taken to a menu with two options: "New Stage", and "Open Stage". Click "New Stage", and you are presented with a save dialog. Navigate to the folder that you intend to store your stages in, and give your new stage a name.
You are now likely to be facing a mostly blank screen. Don't panic! Just start putting image files next to your XML files, and they will show up on the strip at the left side of the screen, as if by magic. To put an object on the stage, click and drag it from the left sidebar to where you want it to go. Edit an image file on disk that you've put on your stage, and KlikPunk will detect that the file has changed and immediately update it on the screen. KlikPunk loves you and wants you to be happy. You are now likely to be facing a mostly blank screen. Don't panic! Just start putting image files next to your .stage files, and they will show up on the strip at the left side of the screen, as if by magic. To put an object on the stage, click and drag it from the left sidebar to where you want it to go. Edit an image file on disk that you've put on your stage, and KlikPunk will detect that the file has changed and immediately update it on the screen. KlikPunk loves you and wants you to be happy.
### Controls ### ### Controls ###
* Tab - show/hide overlays * Tab - show/hide overlays
@ -19,17 +19,17 @@ You are now likely to be facing a mostly blank screen. Don't panic! Just start
* Disk icon - save * Disk icon - save
* Esc - quit to menu * Esc - quit to menu
### Working with KlikPunk XML ### ### Working with KlikPunk JSON ###
KlikPunk saves its stages in a very simple XML format that you can, if you like, use directly to load into your own projects, generate code, etc. It looks like this: KlikPunk saves its stages as very simple JSON objects that you can, if you like, use directly to load into your own projects, generate code, etc. It looks like this:
<stage> {
<token path="relative/path/to/image.png" x="100" y="200"/> "tokens": [
<token path="another_image.png" x="400" y="300"/> { "x": 100, "y": 200, "path": "relative/path/to/image.png" },
</stage> { "x": 400, "y": 300, "path": "another_image.png" }
]
}
The tokens are listed in back-to-front order. The tokens are listed in back-to-front order.
But wait! KlikPunk has an extra-special present for you! If you edit the XML by hand, _any_ other attributes or children you put under a token tag will be preserved when you save the stage from KlikPunk! This means that if there's anything on a stage that you want to be handled special in some way by your game, you can just annotate the token in the XML file and not worry about KlikPunk throwing your hard work away. But wait! KlikPunk has an extra-special present for you! If you edit the JSON by hand, _any_ other attributes or children you add will be preserved when you save the stage from KlikPunk! This means that if there's anything on a stage that you want to be handled special in some way by your game, you can just annotate the token in the JSON file and not worry about KlikPunk throwing your hard work away.
It's not quite smart enough yet to automatically reload from XML that you've modified, but that's coming, friend. It's not quite smart enough yet to automatically reload from JSON that you've modified, but that's coming, friend.
KlikPunk's XML does not use DTDs or namespaces because the author believes them to be an affront to human readability. I probably should have just gone with JSON. Maybe in 2.0.