【问题标题】:Convert Sprite into it's Shadow将 Sprite 转换为它的影子
【发布时间】:2015-03-10 06:01:57
【问题描述】:

我想将 Sprite 转换为它的影子,我尝试使用 glBlendEquation() 函数,但它并没有给出我想要的。我已经按照以下链接进行操作:

http://gamedevelopment.games1234.net/view/63538897166780581719204/rendering-shadow-sprites-in-cocos2d-x

http://discuss.cocos2d-x.org/t/shadow-sprites/1214

这样做的正确方法是什么?

【问题讨论】:

    标签: iphone sprite cocos2d-x shadow


    【解决方案1】:

    我的做法——js实现:

    shadow = cc.Sprite.create("sameNameAsParentSprite.png");
    shadow.setColor(cc.c3b(0, 0, 0));
    shadow.setOpacity(50);
    parent.addChild(shadow, -1);
    shadow.setPosition(cc.p(parent.getContentSize().width * 0.5 + 2, parent.getContentSize().height * 0.5 - 2));
    

    希望对你有所帮助。

    【讨论】:

      猜你喜欢
      • 2020-02-04
      • 1970-01-01
      • 1970-01-01
      • 2015-03-10
      • 1970-01-01
      • 1970-01-01
      • 2014-03-23
      • 1970-01-01
      • 2013-03-28
      相关资源
      最近更新 更多