Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm currently starting a new project with cocos2d-html5. But I already stumbled upon quite a problem. If I load my game in a mobile browser and change the device orientation e.g. from portrait to landscape, the game canvas is no longer fully visible and doesn't fit the new screen dimensions.

For me there are two possible options:

  1. allow only one display orientation (is that possible in mobile browsers?)
  2. resize the game canvas and the cocos2d views after a resize/rotate event happened. Here I have no idea how to do that.

Did someone maybe fix that problem already? I tried google for quite some time but didn't find anything useful.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.