Skip to content

Instantly share code, notes, and snippets.

@AKiniyalocts
Last active August 29, 2015 14:03
Show Gist options
  • Save AKiniyalocts/c5882156a1e03dd42722 to your computer and use it in GitHub Desktop.
Save AKiniyalocts/c5882156a1e03dd42722 to your computer and use it in GitHub Desktop.
Declares all png files as a Texture Region
#!/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