Shadow and CCSprite

Is there a way to make a shadow for CCSprite?

+3
source share
1 answer

Well, you have two options:

1) Bake the shadow in the sprite images themselves or 2) Control the shadow as a separate sprite.

The first approach is the easiest. Open your sprite in Photoshop, set the shadow value for the layer, and then save it back. This will only work if you have a constant light source and you don’t rotate or flip the sprite so that the shadow is in the wrong place.

: . , . , :

 sprite.color = ccc3(0,0,0);

:

 sprite.opacity = 128;
 sprite.scaleY = -1.0;

, . , .

+5

Source: https://habr.com/ru/post/1755041/


All Articles