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 .
darkfrei
Party member
Posts: 1178 Joined: Sat Feb 08, 2020 11:09 pm
Post
by darkfrei » Fri Jan 01, 2021 6:38 pm
Hi all!
I have this code:
Code: Select all
function love.draw()
-- getPixelDimensions
pixelwidth, pixelheight = love.graphics.getPixelDimensions( )
love.graphics.print('pixelwidth: '..pixelwidth..' pixelheight: '..pixelheight, 64, 64)
-- getDimensions
width, height = love.graphics.getDimensions( )
love.graphics.print('width: '..width..' height: '..height, 64, 100)
-- circle in the middle
love.graphics.circle("line", width/2, height/2, math.min(width/2, height/2))
end
It gets the following picture. As you see, the android has covered area, in this situation it's 72 pixels.
1. How to get the size of this cover ribbon?
2. Why getPixelDimensions are not same as getDimensions?
Attachments
covered-03.love
(635 Bytes) Downloaded 209 times
Screenshot_20210101-153150.jpg (89.08 KiB) Viewed 6315 times
darkfrei
Party member
Posts: 1178 Joined: Sat Feb 08, 2020 11:09 pm
Post
by darkfrei » Fri Jan 01, 2021 6:46 pm
For example same code on windows10 (150% scale because of 4K)
(here is no covered area, size and pixel size are same)
Attachments
2021-01-01T19_46_12-Untitled.png (68.37 KiB) Viewed 6312 times
darkfrei
Party member
Posts: 1178 Joined: Sat Feb 08, 2020 11:09 pm
Post
by darkfrei » Fri Jan 01, 2021 6:51 pm
The same, but from the tablet, covered 32 top pixels:
Also 64 bottom pixels, but without covering.
Attachments
Screenshot_20210101-194951.png (42.75 KiB) Viewed 6311 times
slime
Solid Snayke
Posts: 3132 Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:
Post
by slime » Sat Jan 02, 2021 3:13 pm
darkfrei wrote: ↑ Fri Jan 01, 2021 6:38 pm
1. How to get the size of this cover ribbon?
love.window.getSafeArea should get the screen area not covered by the bar I think - if not, there might be issues within SDL that the upcoming love 11.4 release might fix.
darkfrei wrote: ↑ Fri Jan 01, 2021 6:38 pm
2. Why getPixelDimensions are not same as getDimensions?
DPI scaling (which as per the
other thread isn't supported at all on Windows, currently).
AuahDark
Party member
Posts: 107 Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:
Post
by AuahDark » Sat Jan 09, 2021 4:31 am
There's currently issue in 11.3 which causes the area behind the status bar counted as part of the draw area. The upcoming 11.4 fixes that issue.
Profile . Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and
send the full logcat file!
Users browsing this forum: No registered users and 203 guests