titmael Posted May 10, 2014 Share Posted May 10, 2014 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 Thx Link to comment Share on other sites More sharing options...
Pedro Alpera Posted May 10, 2014 Share Posted May 10, 2014 Could be something related with this? http://www.html5gamedevs.com/topic/2530-weird-issue-on-mobile/?hl=android#entry16770 You could use a Background image to solve the problem or draw it with bitmapdata, like this: http://www.html5gamedevs.com/topic/6011-placeholder-graphics-for-sprites/?hl=rect#entry36014 Link to comment Share on other sites More sharing options...
titmael Posted May 10, 2014 Author Share Posted May 10, 2014 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 More sharing options...
jpdev Posted May 10, 2014 Share Posted May 10, 2014 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 More sharing options...
titmael Posted May 10, 2014 Author Share Posted May 10, 2014 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 More sharing options...
titmael Posted May 10, 2014 Author Share Posted May 10, 2014 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 More sharing options...
Recommended Posts