Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 89143

camera.render(node)导致spine动画加速

$
0
0

@ctxdecoco 写道:

  • Creator 版本:2.2.2

  • 目标平台: 模拟器

  • 详细报错信息,包含调用堆栈:

  • 重现方式:新建组件,添加update方法, 创建rendertexture

    @ccclass
    export default class RenderNode extends cc.Component {
       @property(cc.Sprite)
        sprRenderer: cc.Sprite = null;
    
        maskNode: cc.Node = null;
        renderTexture: cc.RenderTexture = null;
    
        onLoad() {
            this.renderTexture = new cc.RenderTexture();
            this.renderTexture.initWithSize(cc.visibleRect.width, cc.visibleRect.height);
            cc.log("renderTexture", cc.visibleRect.toString(), this.renderTexture.width, this.renderTexture.height);
            let spriteFrame = new cc.SpriteFrame(this.renderTexture);
            this.sprRenderer.spriteFrame = spriteFrame;
            this.sprRenderer.node.scaleY = -1;
        }
        update() {
            let cameraMain = cc.Camera.main;
            cameraMain.targetTexture = this.renderTexture;
            cameraMain.render(this.maskNode);
            cameraMain.targetTexture = null;
        }
    }

会导致游戏内的spine动画加速运行

  • 之前哪个版本是正常的 :

  • 手机型号 :

  • 手机浏览器 :

  • 编辑器操作系统 :mac

  • 编辑器之前是否有其它报错 :没有

  • 出现概率:100%

  • 额外线索:

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 89143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>