Making sprite partially invisible with alpha overlay?

CircleTimeCircleTime Member Posts: 84
edited May 2013 in Working with GS (Mac)
In my game, my character needs to eat many different objects, one bite at a time. Because there are so many different objects to eat, I do not think it would be memory efficient to make animations of each object being eating away via subtractive bites. So I want to know if it is possible to make a universal bite animation system, that uses transparency to make objects partially disappear, bit by bit? Loosely, I'm imagining somehow overlaying *magic transparent* alpha channel bite shapes on the objects that are being eaten. However, before I attempt this direction (as a Gamesalad novice), any advice if this seems possible? Any advice on another direction to accomplish this?

Thank you in advance,
CircleTime

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited May 2013

    Hi @CircleTime I don't think different frames of each object being eaten will take up too much memory, but if you don't want to go down that route...

    There's no way to make bits of an image transparent as you go at runtime...

    The only way I can think of would only work if you've a plain and flat colour background, that way you could mask the objects bit by bit with an actor the same colour as the background colour.

    Perhaps the following might look OK for you, a sort of symbolic eating of the objects: have the whole food item slowly fade to transparent along with reducing in size. Try it, you might like the look of it...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • BoomshackBarryBoomshackBarry Member Posts: 712
    It's not ideal but you could make each edible item out of multiple actors, maybe quarters, and make the edges between each quarter bite shaped. This way they'd look like one item when they're all pieced together (imagine pieces of a jigsaw puzzle locking together) and you could make each actor disappear with each bite.

    Although the performance impact of using more actors might be worse than just using multiple images.

    Hope that makes as much sense as it does in my head :)
  • AfterBurnettAfterBurnett Member Posts: 3,474
    edited May 2013
    I'd just use separate frames of animation. You really don't need to worry about memory with something like that on today's devices :) And your "magic transparency" bits would need to be separate images anyway (not that overlaying transparency is possible), so would use the same memory, if not more.
  • CircleTimeCircleTime Member Posts: 84
    Thank you, gyroscope, BoomshackBarry, and POLYGMe. This helps me much. I now know not to pursue the bits of objects becoming transparent during runtime. I will use multipul actors with the edges bite shapes. Thanks all, you saved me a lot of experimenting time.
Sign In or Register to comment.