Real Sprites PLEASE!!!

carlos.varela.comcarlos.varela.com Member Posts: 99
edited November -1 in Working with GS (Mac)
It's so complicate to split all my ready sprites into separates files.

Are anyway to automate these splits?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    no idea.

    I hope we still get the option to use the anim system 'as is' if sprite sheets are introduced. I'm used to making my graphics this way now!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • wayneh001wayneh001 Member Posts: 300
    Bring Spritesheet support to GS - Please - I back that!

    @Carlos
    The best way to 'Split' your current Spritesheet to separate Sprite files would be to:
    1. Open image in Photoshop
    2. View | New Guide
    3. Insert vertical & horizontal guide lines to split up the sheet (I just divide the image dimensions by # of frames and use those values for where the place the guides)
    4. Select slice tool
    5. Choose "Slice from guides"
    6. File | Save For Web & Devices
    7. Save Images Only

    This will give you your individual PNG Sprite files.

    @QS
    Using Spritesheet animation using OpenGL ES with iPhone SDK is significantly faster than preloading each sprite entity separately. The memory footprint is significantly reduced If Spritesheets are used. The speed increase can be significant across an entire project. As the engine need only load 1 file (the Spritesheet), you then use the co-ordinates and size to locate your Sprite within the Sheet.

    Creating Spritesheets can be very easy using various tools like [Zwopple] for example.
    http://zwoptex.zwopple.com/

    Zopple, can take each of your individual sprites and create a combined PNG File (Spritesheet) and a separate XML file which defines the X,Y, Size of each sprite.

    Wayne
  • carlos.varela.comcarlos.varela.com Member Posts: 99
    I have been testing with a command line tools called ImageMagick that maybe easy to crop your sprites, but when you crop sprites with transparent background, it does not work, it put a black blackground, also with Pixen that have an option of Create Animation from image, does not work either. I have snow leopard 10.6.3

    wayneh001: thanks, I will try your option.
  • quantumsheepquantumsheep Member Posts: 8,188
    Wayne,

    Cheers for that sprite sheet maker tool - I was thinking how much of a hassle it would be to do that!

    Your ideas are intriguing to me and I wish to subscribe to your newsletter.

    ;)

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • wayneh001wayneh001 Member Posts: 300
    @Carlos
    I Have just tested ImageMagick 6.5.9 installed on a Snow Leopard 10.6.3 Mac.
    The [-crop] command does respect the transparency of PNG files when cropped.

    ie Using Terminal:
    `convert test.png -crop 50x50 test2.png`

    This results in a new PNG file being created with the Transparency correct.
    Could you try forcing the transparency with the [-background none] command ie:

    `convert test.png -crop 50x50 -background none test2.png`

    Also possibly check which version of ImageMagick you are using.

    @QS
    Sorry, I don't have any Blogs or Newsletters; maybe it's time to set something up.
  • carlos.varela.comcarlos.varela.com Member Posts: 99
    In my case, does not work : ( I am using the version that install MacPorts_1.8.2 installer, it install:

    sherezade:~ cgvarela$ convert -version
    Version: ImageMagick 6.6.1-0 2010-04-09 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
    Features: OpenMP OpenCL

    I am not sure that this is the las version, because when you download directly from the ImageMagick site the .tar.gz say 10.2.0 ???

    Please, Which version do you have?
  • carlos.varela.comcarlos.varela.com Member Posts: 99
    Are there another similar way to do what ImageMagick do?
  • wayneh001wayneh001 Member Posts: 300
    Hi Carlos,

    I've just installed the latest version of ImageMagick on another Intel/Leopard (10.6.3) Mac.
    Using the following URL and instructions:

    http://www.imagemagick.org/script/binary-releases.php?ImageMagick=i7pr0tcinjab9dn4fd8bc4brd5#macosx

    Again, the transparency aspect of the PNG files, once cropped, was respected. Maybe try uninstalling and installing manually using the instructions in the URL above.

    ************************* [ SIPS ] **************************
    Another method you could maybe try is to use Mac OS X's [`sips`] command?

    1. Open Terminal
    2. Enter [`sips`] commands: eg: [`sips testimage.png -c 50 50`]

    the [`-c`] flags the built in `sips` engine to [`crop`] the image. There are lots of tools similar, but not as advanced as ImageMagick.

    Again, on all of my machines this respects the Transparency.
    Do note this method is destructive to the original image, so DO MAKE A COPY FIRST.

    For more information on `sips` review the Manual in terminal: `man sips`.

    or view the following Apple Developers Website info:

    http://developer.apple.com/Mac/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html

    Wayne
  • quantumsheepquantumsheep Member Posts: 8,188
    @Wayne:

    I actually meant this:

    :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • carlos.varela.comcarlos.varela.com Member Posts: 99
    Thnx man! and thanks for the video too ; ))
  • wayneh001wayneh001 Member Posts: 300
    Hehehe - good video...
  • carlos.varela.comcarlos.varela.com Member Posts: 99
    Hey wayneh001,

    Now its working well! Thanks, just uninstall 6.6.1 and reinstall 6.5.9

    Is it possible to do wildcards like *.png?

    Thanks again and for the next beers "own the house", but with some "tapas" here in Madrid
    quantumsheep, we will hope to see you too!

    ; ))P
  • quantumsheepquantumsheep Member Posts: 8,188
    You never know - I have some friends in Madrid :P

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.