Gimp Script for exporting positions of all the layers.
I have created a Python script which can export layer positions in a text file.
Usability:
Are you using GIMP for creating maps for your game? You want to create a 1024x768 map and put objects in it but cannot export the positions? This script can help you get the positions of your objects.
Procedure:
How to install the plug-in?
Firstly ensure that you have Python installed in your system. Try to install gimp until you see option of "GIMP python plugin" options checked while installation.
If you haven't installed it please install these packages, This is my installer package: gimp-2.6.11-i686-setup, python-2.5.2.msi
However you can download individual packages by google
gtk-2.12.9-win32-1.exe, pycairo-1.4.12-1.win32-py2.5.exe, pygobject-2.14.1-1.win32-py2.5.exe, pygtk-2.12.1-2.win32-py2.5.exe, python-2.5.2.msi
Or follow this page:
http://www.gimpusers.com/tutorials/install-python-for-gimp-2-6-windows
Install the plugin
Copy the python script to:
WIndows: C:\Documents and Settings\USER\.gimp-2.6\plug-ins
Linux: ~/.gimp-2.6/plug-ins
and restart gimp.
Verify that you have gimp python plugins enabled by following these steps:
Filters -> Python-Fu -> Console
type this:
>>> import gimpfu
>>> gimp.version
(2, 6, 11)
Example map and exported file:
Format:
"layer name" X-Pos Y-Pos
"breakable_tile_2 copy#6" 195 377
"breakable_tile_2 copy#5" 252 351
"breakable_tile_2 copy#4" 143 351
"breakable_tile_2 copy#3" 197 330
"breakable_tile_2 copy#2" 204 137
"breakable_tile_2 copy" 148 114
"breakable_tile_2 copy#1" 258 113
"breakable_tile_2" 202 88
"striker" 191 199
... more dump stripped off
Download:
layer-position-dumper.7z
TAGS for google:
export layer positions, export positions of layers in gimp
I have created a Python script which can export layer positions in a text file.
Usability:
Are you using GIMP for creating maps for your game? You want to create a 1024x768 map and put objects in it but cannot export the positions? This script can help you get the positions of your objects.
Procedure:
- Run GIMP and create a desired resolution image.
- Drag and add your object's images in gimp.
- Ensure that you crop the layers so that extra alpha (transparent) areas are not remained in objects.
- Duplicate the objects to the numbers you want and place them to positions you want.
- Do same with other objects, backgrounds.
- Now export their positions. Filters -> Positioning -> Layers Position Dumper
- Put the file name with full path in next dialog. e.g. ~/my_game_map.txt in Linux Or c:\my_game_map.txt in windows. Click Ok.
- Now you can check the exported file which contains the positions of all the layers.
How to install the plug-in?
Firstly ensure that you have Python installed in your system. Try to install gimp until you see option of "GIMP python plugin" options checked while installation.
If you haven't installed it please install these packages, This is my installer package: gimp-2.6.11-i686-setup, python-2.5.2.msi
However you can download individual packages by google
gtk-2.12.9-win32-1.exe, pycairo-1.4.12-1.win32-py2.5.exe, pygobject-2.14.1-1.win32-py2.5.exe, pygtk-2.12.1-2.win32-py2.5.exe, python-2.5.2.msi
Or follow this page:
http://www.gimpusers.com/tutorials/install-python-for-gimp-2-6-windows
Install the plugin
Copy the python script to:
WIndows: C:\Documents and Settings\USER\.gimp-2.6\plug-ins
Linux: ~/.gimp-2.6/plug-ins
and restart gimp.
Verify that you have gimp python plugins enabled by following these steps:
Filters -> Python-Fu -> Console
type this:
>>> import gimpfu
>>> gimp.version
(2, 6, 11)
Example map and exported file:
| snap from our mobile game "Catch N Snatch" whose maps are developed using GIMP |
Format:
"layer name" X-Pos Y-Pos
"breakable_tile_2 copy#6" 195 377
"breakable_tile_2 copy#5" 252 351
"breakable_tile_2 copy#4" 143 351
"breakable_tile_2 copy#3" 197 330
"breakable_tile_2 copy#2" 204 137
"breakable_tile_2 copy" 148 114
"breakable_tile_2 copy#1" 258 113
"breakable_tile_2" 202 88
"striker" 191 199
... more dump stripped off
Download:
layer-position-dumper.7z
TAGS for google:
export layer positions, export positions of layers in gimp