Canvas变透明

有没有什么办法,使Canvas变透明。在原生的web页显示creator项目,想让canvas变透明。

控制 Opacity 达不到效果么?

他的所有子节点都会不显示的

调整摄像机?(camera)

设置 “最先渲染的摄像机” 的clear color 为 0,0,0,0 试试?

https://dotblogs.com.tw/Game_Daily/2018/08/29/change_CocosCreator_transparent
打web包,找到main.js和style-mobile.css。
在main.js里面添加:


cc.director.setClearColor(new cc.Color(0, 0, 0, 0));
cc.macro.ENABLE_TRANSPARENT_CANVAS = true;
在style-mobile.css里面
body的background-color设置为 transparent
Cocos Creator中的摄像机的color的勾去掉
image
解决。

2赞

MARK.

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。