Why does enabling high-dpi shrinks the whole viewport to half?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
slmjkdbtl
Prole
Posts: 14
Joined: Sat Feb 25, 2017 8:36 am
Location: New York
Contact:

Why does enabling high-dpi shrinks the whole viewport to half?

Post by slmjkdbtl »

After scaling to the right size with

Code: Select all

love.graphics.scale
, it seems to be twice scaled when I ported it to web using love.js. I used highdpi so things look more right on iOS. So why does high-dpi shrinks the viewport in the first place?
嗡嗡嗡
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Why does enabling high-dpi shrinks the whole viewport to half?

Post by slime »

in LÖVE 0.10, the graphics coordinate system is in pixels. When you use a retina monitor with highdpi mode enabled, the pixel density of the window increases – i.e. a 2x retina screen with highdpi mode enabled will cause a 100 pixel wide rectangle to look half as wide as on a 1x screen, for example (since there are twice as many pixels in the same physical area).

LÖVE 0.11 will help by making the graphics coordinate system use DPI-scaled points for the most part, which means you won't have to do any scaling for most things.

I'm not sure if SDL2's emscripten backend used by love.js implements highdpi mode properly.
Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 28 guests