Jump to content

Android doesn't load atlas and sound?


Recommended Posts

Hello again!


Maybe this question was already answered, but I couldn't find it. So, sorry if I'm repeating it!


I'm almost finishing one game I made, and I've tried to run it on a Samsung Galaxy Tab 10.1's chrome browser. When the game starts, the background is tweened normally, but the cards (which are all in the same texture atlas) are not drawed. Also my sound isn't working either.


Can anybody help me? One of my intents with phaser is to deploy in Android, so I would be very grateful if someone can tell me a solution.


​Thanks for your time!

Link to comment
Share on other sites

I expect there is something else going on - if part of your atlas appears fine then the image and atlas data obviously loaded without a problem. You could boil it down to a really simple test case though, just take one of the atlas examples, swap for your own, and try to display some of the frames.


The sound could be anything really, need more information to figure it out (could be a codec issue for example).

Link to comment
Share on other sites

My backgrounds are not in the Atlas, the Atlas only holds the card images. It's even applying the tween on the black square it shows, just the images that are not showing up.

And my sound is in both .ogg and .mp3 formats. It should be playing at least one of them.

I'll try another project where it just shows one image from the atlas, and I'll post the feedback here.


Link to comment
Share on other sites

I'll try that! I've never debugged that way before, so it will take some time before I answer xD
And sorry for the delay between my answers, I only access the forum in this time period (between 7 o'clock and 12 o'clock)

Thanks for your attention!


Link to comment
Share on other sites

I've tried to switch from WebGL to Canvas, and it worked! I don't know why, but WebGL doesn't render the atlas' images! (My tablet is using android 4.0.4, and his Chrome version is 32.0.1700.99).

And any ideas on the sound part? I'm really confused here xD

Link to comment
Share on other sites

I also had problems with the stock browser on the Galaxy Tab 3, and like you said using canvas fixed it.

So I added this hacky fix for now.


var ua = navigator.userAgent;
var bAndroid: boolean = (/Android/.test(ua));
var bChrome: boolean = (/Chrome/.test(ua));
if (bAndroid && !bChrome )
  super(width, height, Phaser.CANVAS, 'game', null);
  super(width, height, Phaser.AUTO, 'game', null);
Link to comment
Share on other sites

I was studying about that atlas problem, and I'm sure there's something about the dimensions of the frames in the atlas. It seems WebGL has a specific requirement about that, but the console message does not say much.

I'm glad my post was useful for you!

Link to comment
Share on other sites

About the atlas problem, I've discovered the hard way why it wasn't working.

The atlas' dimensions must have the maximum size of 2048 x 2048. That allows the iOS to handle the atlas and WebGL activates.

About the audio issues, no one could (or maybe wanted to) help me yet.

So I'll mark this as answered, but it's not fully answered yet, any help with the sound part would be appreciated! 

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.

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.


  • Recently Browsing   0 members

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