[]graphics透明度设置详细步骤

调整一个graphics的透明度需要4个步骤 save;alpha;draw;restore; 
比如:
//画一个半透明屎黄色区域
this.graphics.save();
this.graphics.alpha(0.5);
this.graphics.drawRect(-40, -110, 80, 110, "#ffcc00");
this.graphics.restore();
//再画一个红色小半透明区域
this.graphics.save();
this.graphics.alpha(0.7);
this.graphics.drawRect(40, -110, 80, 110, "#ff0000");
this.graphics.restore();
4个步骤缺少哪一个都不行,alpha和drawRect前后也不能换。
已邀请:

cuixueying

赞同来自:

谢谢!

要回复问题请先

商务合作
商务合作