Last active
August 29, 2015 14:03
-
-
Save AKiniyalocts/c5882156a1e03dd42722 to your computer and use it in GitHub Desktop.
Declares all png files as a Texture Region
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# 1. Place this in the /android/assets/images directory | |
# 2. chmod 755 DeclareTextureRegions.sh to make it executable | |
# 3. ./DeclareTextureRegions | |
# 4. Enter the directory you wish to generate statements for e.g. (pg03) | |
# 5. A file will be created in that images folder that contains statements for those png files. | |
echo "enter the path containg the images: " | |
read path | |
for images in `ls $path` | |
do | |
y=${images%%.*} | |
echo "$y = new TextureRegion(new Texture(Gdx.files.internal(\"images/$path/$images\"), true));" >> DeclaredAssets_$path.java | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment