Hi,
I used to get MINX, MAXX, MINY, MAXY by this code:
--static variable
local math_floor = math.floor;
local lw = application:getContentWidth()
local lh = application:getContentHeight()
_G.MINX = math_floor(-application:getLogicalTranslateX() / application:getLogicalScaleX())
_G.MINY = math_floor(-application:getLogicalTranslateY() / application:getLogicalScaleY())
_G.MAXX,_G.MAXY = lw - MINX,lh - MINY;
_G.W, _G.H = MAXX - MINX, MAXY - MINY;
_G.CX,_G.CY = MINX + W * 0.5, MINY + H * 0.5
print ( "MINX, MAXX, MINY, MAXY",MINX, MAXX, MINY, MAXY) |
But in 2015.07.15 version, when i run gideros player on sony device ( 720 x 1280), it printout:
MINX, MAXX, MINY, MAXY -112 1312 -0 800 |
It should be:
MINX, MAXX, MINY, MAXY -58 1258 -0 800
(Tested in 2014.01) |
(My project config as image attach)
Is this a bug or can you show the new codes to get real device bounds?
Thank!
Comments
By the way, Here is simple code to draw two rects that fit the screen on all devices, and you can get MINX, MINY, MAXX, MAXY,Width, Height, CenterX, CenterY of screen. Maybe that help someone!
Likes: vitalitymobile
https://deluxepixel.com
Just to add something I am not sure about: I read in various docs that lua handles multiplications faster than divisions, so you can change the /2 with *.5
I don't think that this would be a major improvement in performance, but maybe a bit here and another there would
:P
Likes: pie