Clear edged sprite
Posted
by
Ananth
on Game Development
See other posts from Game Development
or by Ananth
Published on 2012-06-21T07:46:33Z
Indexed on
2012/06/21
9:24 UTC
Read the original article
Hit count: 326
I am a newbie to cocos2d. I would like make user to draw similar to what a painting brush would do.
I am using CCSprite
for that. I almost implemented the velocity, color and opacity factors for that tool, but I couldn't get the Sprite to be as clear as it should be. I can draw only in the below image http://i.imgur.com/KBe0L.png
which has blunt edges. But I want it to be harder / clear outside edges as in http://i.stack.imgur.com/GrFlv.png.
I am getting no idea to make it clear edged. The piece of code Im using is
glEnable(GL_BLEND);
[brush.texture setAliasTexParameters];
[brush setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}];
[brush visit];
I suspect the problem would be on blending mode. I tried some blending modes, but with no expected results. I am trying this for the past five days and so confused. Can some one help me sort this out?
Thanks in advance.
© Game Development or respective owner