Set background color in 0.9.4

Got a question? Need help? Post here!

Set background color in 0.9.4

Postby Ats » Sat Oct 04, 2014 9:42 am

Hi, now I have a weird problem with 0.9.4 (r2 or r3): the background of the game turned grey in my games.
The color I'm choosing is taken into acount when I launch the game but then it turns grey...
I'm using [SWF(width = "488", height = "488", backgroundColor = "#ffffff")] which was working fine under 0.9.3
Do I have to setup the Ax.background now or something like that?
Thanks :)
Ats
Master Sergeant
 
Posts: 33
Joined: Wed Mar 06, 2013 6:10 pm

Re: Set background color in 0.9.4

Postby Arkeus » Sat Oct 04, 2014 9:47 am

Yeah, you do. I'm not sure why it would have ever worked before, since the canvas is cleared using the Ax.background color every frame (which is drawn on top the stage so it hides the swf background).

Typically done by overriding create() in your main class (that extends Ax) and doing something like:

Code: Select all
Ax.background.hex = 0xffffffff;


Making sure that the first 2 (alpha) are ff.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: Set background color in 0.9.4

Postby Ats » Sat Oct 04, 2014 10:22 am

It's working like a charm. Thank you, I'm almost done porting my projects to 0.9.4 ;)
Ats
Master Sergeant
 
Posts: 33
Joined: Wed Mar 06, 2013 6:10 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron