如何在TweenMax脚本中删除黑色背景

问题描述 投票:0回答:1

我使用TweenMax和pixi.js

codepen.io/nimaina/pen/aPERKO

如何删除黑色背景?

pixi.js tweenmax
1个回答
1
投票

那么你看到的黑色背景是默认的PIXI.Application设置。

默认宽度:800

默认高度:600

默认backgroundColor:0x000000(黑色)

基本上我有两种选择,以避免黑色背景。

选项1:使用精确尺寸的宽度和高度

我看到greensock.png的尺寸是538x173。

var app = new PIXI.Application( {
  view: document.querySelector("#canvas"),
  width: 538,
  height: 173
});

选项2:设置transparent:true并使背景透明

var app = new PIXI.Application( {
  view: document.querySelector("#canvas"),
  transparent: true
});
© www.soinside.com 2019 - 2024. All rights reserved.