Jump to content
GreenSock

TELLO

How to change the Backgroundcolor PixiPlugin?

Moderator Tag
Go to solution Solved by OSUblake,

Recommended Posts

Hi all,

 

how can i change with timeline the backgroundColor of the PIXI.Application?

 

const app = new PIXI.Application({
    backgroundColor: 0x1099bb, resizeTo: window
});

 

THanks

Link to comment
Share on other sites

  • Solution

Hi TELLO,

 

The PixiPlugin is only designed to work with DisplayObjects. It would probably be easier if you just had an blank sprite that filled up the screen and animated that color. 

 

GSAP will automatically detect colors, but only if they are a string, and PixiJS uses numbers, so you could just convert the color to a string, animate that color on a proxy object, and then apply the changes to the renderer.

 

This could be optimized more, but it's just a quicky example.

 

See the Pen ZEaKRxg by GreenSock (@GreenSock) on CodePen

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×