Jump to content

Device aspect ratio


craidencool
 Share

Recommended Posts

18 hours ago, VitaZheltyakov said:

var canvas_width = window.screen.availWidth * window.devicePixelRatio;
var canvas_height = window.screen.availHeight * window.devicePixelRatio;
var aspect_ratio = canvas_width / canvas_height;

 

Im sorry sir im really new with game development, the aspect_ration variable results to (E.G 1.88) but isnt aspect ratio is like (16:9, 5:4) thank you again. I am still very unfamiliar. 

Link to comment
Share on other sites

49 minutes ago, Newbie_HelpMe said:

Im sorry sir im really new with game development, the aspect_ration variable results to (E.G 1.88) but isnt aspect ratio is like (16:9, 5:4) thank you again. I am still very unfamiliar. 

You forget, that there is OS statusbar. We have not the aspect ratio of the screen.

Link to comment
Share on other sites

1 hour ago, VitaZheltyakov said:

You forget, that there is OS statusbar. We have not the aspect ratio of the screen.

Not if you compile it into a fullscreen app with PhoneGap or such? Correct me if I'm wrong.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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