我一直在尝试更改填充和线条属性,例如lineColor和lineWidth,在控制台中记录该对象时,它会显示该值已更改,但不会重新呈现它,并且会显示初始颜色或宽度。 / p>
我尝试通过使用新的gsap语法
import PixiPlugin from "gsap/PixiPlugin";
gsap.registerPlugin(PixiPlugin);
PixiPlugin.registerPIXI(PIXI);
,但是它对于具有子属性的任何补间都不起作用,所以我使用的是旧语法,下面是代码
const App =()=>{
function onClick()
{
gsap.to(this.fill,1,{color:0x000000})
// gsap.set(this,1 {x:550,tint:0x9013FE,height:200})
console.log(this)
}
}
return(
<Stage
width={width}
height={window.innerHeight*8.67/10}
options={{ antialias: true,resolution:window.devicePixelRatio || 1,autoResize:true,backgroundColor: 0x000000,x:400,y:900 }}>
<Graphics
key={0}
interactive={true}
draw={graphics =>{
graphics.linestyle(2,0xffffff,1);
graphics.beginFill(0xff00bb,0.25);
graphics.drawPolygon([ 150,450,550,150,550]);
graphics.endFill();
graphics
.on('mousedown',onClick)
.on('touchstart',onClick)
}
}/>
</Stage>
)
}
export default App
我尝试使用色度,但是当持续时间> 0时,它会变为多种颜色,从长期来看,我认为它效率不高,最后如您所见,我正在使用react