Sharp edged sprites

时间秒杀一切 提交于 2020-01-16 18:41:27

问题


Im new to cocos2D and I would like to draw as

I tried using CCSprite and also tired to resolve it using

[brush setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; [brush.texture setAliasTexParameters];

But I got only image as

in which the edges are blunt/blur. How I can make the blur edged images as sharp as the first one? Can someone suggest me the right way??

The code I use to generate the above image is

  brush = [CCSprite spriteWithFile:@"sketch.png"];
  [brush setColor:ccc3(0, 0, 0)];
  brush.scale = 1.5f;
  [brush setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}];
  [brush.texture setAliasTexParameters];

In gesture method,

  [brush setPosition:curntPoint];
  [brush setRotation:rand() % 360];
  [brush setOpacity:brushAlpha];

Thanks in advance.

来源:https://stackoverflow.com/questions/10949104/sharp-edged-sprites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!