바다를 담은 것은 무엇을 변경하는 가장 좋은 방법은 그래픽 객체의 색깔?

0

질문

하고 싶은 간단한 스퀘어 개체 플래시 녹색,파란색,빨간에 따라 다른 조건이 있다. 나는 없다는 것을 이해 직접적인 방법의 색상을 변경하는 그래픽 객체에 바다를 담은 것. 현재들은 그래픽 객체는 제외하고는 동일한 색상을 확인합니다. 중복하여 이러한 객체를 조정 가시성,이를 달성하는 번쩍이는 애니메이션이다.

면 더 나은 방법을 변경""컬러 대신 그것을 부정 행위로 표시.

현재 코드:

let square_red = new PIXI.Graphics();
square.beginFill(red, opacity);
square.lineStyle(lineStyle);
square.drawRect(0, 0, width, height);
square.position.set(x, y);

let square_green = new PIXI.Graphics();
square.beginFill(green, opacity);
square.lineStyle(lineStyle);
square.drawRect(0, 0, width, height);
square.position.set(x, y);

let square_blue = new PIXI.Graphics();
square.beginFill(blue, opacity);
square.lineStyle(lineStyle);
square.drawRect(0, 0, width, height);
square.position.set(x, y);

square_red.visible = true;
square_green.visible = false;
square_blue.visible = false;
javascript pixi.js
2021-11-22 06:59:45
1

최고의 응답

0

을 만들 수 있습니다 흰색을 원하고 변경의 색조습니다.

const circle = new PIXI.Graphics();
circle.beginFill(0xffffff);
circle.drawCircle(0, 0, 100);
circle.endFill();

circle.tint = 0xff0000;
2021-11-23 14:38:42

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................