Jump to content

Strange color problem on mobile


titmael
 Share

Recommended Posts

Hi,

 

in my game I'm changing the stage.backgroundColor with an hexa number. It's working well on my laptop and chrome browser. But on mobile it doesn't, it keeps showing green color (colors I'm setting are blue colors).

 

Here is a screenshot on mobile device

598270Screenshot20140510104127.png

 

Thx  ;)

 

Link to comment
Share on other sites

Hmm interesting, I'll try another way. My game is about a meteor falling down from the space to the Earth, so I need to regulary change the color, I can't use an image. I'll try with a graphic

Link to comment
Share on other sites

You could also try changing the way you set the color.

 

If right now you are using 0xABFF00 for example, try chagning it to "#ABFF00".

 

(Javascript hex vs. javascript string with html-hex-color)

 

Maybe one of these methods works on mobile. (I remember some thread, where one of these notations worked and one didn't.)

Link to comment
Share on other sites

I found a way to do it without lags on computer : I add a bitmap on a sprite and tint it.

 

I tried to draw a rect on a sprite but it made the game lag on the computer :( I still have some lags on mobile but I thinks I need to clean a bit my code and refactoring some things.

Link to comment
Share on other sites

You could also try changing the way you set the color.

 

If right now you are using 0xABFF00 for example, try chagning it to "#ABFF00".

 

(Javascript hex vs. javascript string with html-hex-color)

 

Maybe one of these methods works on mobile. (I remember some thread, where one of these notations worked and one didn't.)

 

Nice, it's working with int colors (I use parseInt(hexa, 16) to get it. Thx !

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...