Hi Gideros,
I am facing a problem while positioning the object in Gideros where it will differ the position when we install in different resolution device. As i have already solved the Image orientation and scaling problem this i am facing newly. Even we follow Stage center concept if we want to give some offset value which will vary in different devices. So is there any calculation which will convert MDPI value to other assets like HDPI XDPI ??? If so please help me in this problem.
Example : myMC.x = conf.width/2 - 165
Where 165 is the extra offset which i need to give to set the exact position in screen.
But if the same 165 may give the wrong position for larger density than current one. So please help me i think this is enough to know my problem.
Thanks and Regards,
Dorado Lab
Comments
do you use any scaling modes?
this my solution:
1- choose a resolution for your base design (example: 600*800 for PORTRAIT)
2- write this: application:setLogicalDimensions(600, 800)
3- use letterbox mode for Scaling
4- write this: application:setScaleMode("letterbox")
5- define grid for better positioning
6- write this: grid = application:getContentWidth()/60 (grid is 600/60=10 pixel in this example)
7- calculate value grid base (165 = 16.5*grid)
8- position it! (yorObject:setX(16.5*grid))
I have tried... it worked for 'x' but not for 'y'... Please can you explain briefly. Also i use application:setLogicalDimensions(480, 800)...
Please do reply me.
Thanks,
Dorado Lab
try clicking right click on the project, selecting properties and adding logical dimensions there.
also recheck that you have letterbox
of course from the screen side the the position will be different, because of different aspect ratios, there are different white spaces
so if you want to position object from specific amount from the side of the screen, check out absolute positioning or how to ignore scaling:
http://appcodingeasy.com/Gideros-Mobile/Ignore-Automatic-Screen-Scaling-when-positioning-objects
Even though the 0,0 is top left of the screen the image is not at all set to that position. mainly Y in all case. Please help me in this....
Thanks,
Dorado Lab
http://appcodingeasy.com/Gideros-Mobile/Ignore-Automatic-Screen-Scaling-when-positioning-objects