-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Core: Fixes To Display Capture/Save Resolution #527
Core: Fixes To Display Capture/Save Resolution #527
Conversation
@scottrules44 Sent you a DM in Discord about this. |
Just tried on a iPad Pro 10.5 and iPad 6th gen and both return correct screen resolutions |
^ I noticed when I switch to Android my Pixel 6a was off a bit, so I started over from scratch and based off @ggcrunchy comments(ty btw) I used more precise method for getting the width and height by passing Real/float values into "ContentToScreen". @Shchvova It should be noted this won't breaking anything because I basically created a variant of ContentToScreen, one that take in reals/floats and one that takes ints. :) |
This is the test project I used btw |
@scottrules44 After this pull request, local bkg = display.newRect(display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight )
bkg:setFillColor(1, 0, 0, 1)
local function onColorSample( event )
print( "Sampling pixel at position (" .. event.x .. "," .. event.y .. ")" )
print( "R = " .. event.r )
print( "G = " .. event.g )
print( "B = " .. event.b )
print( "A = " .. event.a )
end
timer.performWithDelay(100, function()
display.colorSample( display.contentCenterX, display.contentCenterY, onColorSample )
end) Now it always print R = 0, G = 0, B = 0, A = 0. application =
{
content =
{
fps = 60,
width = 1536,
height = 2048,
scale = "letterbox",
xAlign = "center",
yAlign = "center",
}
} |
Fixed with #575 |
This is aimed to fix #515 (and probably a few more)
I tested this on my iPhone 14 Pro and iPad Air(which was originally wrong), and this gave me the correct image output resolution :) . Will try to test on more devices I have access to (including Android), but having trouble running
iPhone
"template" project on iOS simulators(get a bunch of undefined symbols).