0
\$\begingroup\$

I'm making a HTML5 game using the canvas. I was building it for my iPhone 6 which state a resolution of 1334x750 pixels but also a resolution of 667x375 points. I notice that my canvas need to match the size in points or else it would go beyond the screen.

<canvas width="667" height="375" />

Is it possible for my canvas to actually be 1334x750? Or am I stuck at 667x375?

\$\endgroup\$
  • \$\begingroup\$ Have you tried putting "px" after the sizes? \$\endgroup\$ – Bálint Mar 7 '18 at 16:52
  • \$\begingroup\$ @Bálint I thought I tried it but I'll try again tonight. \$\endgroup\$ – the_lotus Mar 7 '18 at 17:05
0
\$\begingroup\$

You are not "stuck" at a lower resolution, since the device will use it's actual resolution.

As far as I understand, at a logical level you will be using points (not pixels). If you were to work on pixels, your game would look bigger on older devices with less pixel density.

More info here: https://stackoverflow.com/questions/12019170/what-is-pixel-and-points-in-iphone

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.