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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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