[LayaAir3]layaair3.1.3 2d cacheAs 不起着用?

        let textBox = new Sprite();
   
        
        this.owner.addChild(textBox);
        // 随机摆放文本
        let text;
        for (let i = 0; i < 1000; i++) {
            text = new Text();
           
            textBox.addChild(text);
            text.fontSize = 20;
            text.text = (Math.random() * 100).toFixed(0);
            text.rotation = Math.random() * 360;
            text.color = "#ccc"; 
            text.x = Math.random() * this.pageWidth;
            text.y = Math.random() * this.pageHeight;
        }
        //缓存为静态图像
        textBox.cacheAs = "normal";
 
 
2024-05-08_12-17-36.jpg
已邀请:

要回复问题请先

商务合作
商务合作