Hello Guest

Author Topic: Advice on how to accomplish an effect on a tk2d sprite  (Read 3621 times)

iamagiantnerd

  • Guest
Advice on how to accomplish an effect on a tk2d sprite
« on: January 07, 2014, 03:09:28 am »
I have a bunch of monster sprites in my game.  I'd like to be able to apply an "ice block" effect.  I mocked something up in gimp to show what I'd like to do:

Before effect applied:


After effect applied:


I could imagine doing this by creating an image dynamically by reading the pixels of the original and manipulating them, but I would think there might be a better way.  Shaders?  I'd appreciate any ideas you folks might have.

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Advice on how to accomplish an effect on a tk2d sprite
« Reply #1 on: January 07, 2014, 10:48:20 am »
Not the easiest thing to do with shaders. You will need additional information in the alpha channel to be able to perform the outline - one tip is to use 2 thresholds in the alpha, say 0.5 for the outline and 1 for full transparent. When drawing the normal sprite without the outline, it simply uses 0.5 as full transparent.