[]graphics透明度设置详细步骤
调整一个graphics的透明度需要4个步骤 save;alpha;draw;restore;
比如:
比如:
//画一个半透明屎黄色区域4个步骤缺少哪一个都不行,alpha和drawRect前后也不能换。
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();
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
cuixueying
赞同来自: