Hi
While investigating Multi-Resolution images I came across this Wiki article
http://www.giderosmobile.com/documentation/automatic_image_resolution.htmlIt says to run the example project "Hardware/Automatic Image Resolution" which I did. This project has very simple code:
local image = Bitmap.new(Texture.new("image.png", true))
stage:addChild(image) |
However when I run this sample using the Gideros player I get improper results for everything except for the iPhone.
iPhone - 320x480 and Retina - 640x960 - image displays correctly at the top left(0,0)
iPad - Both normal and Retina - image displays with white space to the
LEFT of the image - NOT at 0,0 as expected
iPhone5 = Both Normal and Retina - image displays with white space at the
TOP of the image - NOT at 0,0 as expected.
And the same result when running on my iPad player - White space on the left.
Is this a bug or how to get images to display at 0,0 at any resolution?
Comments
http://appcodingeasy.com/Gideros-Mobile/Ignore-Automatic-Screen-Scaling-when-positioning-objects
or
try different scale mode my favorite is stretch
Automatic image resolution is about which size of image to load based on which resolution. Thats why you'll have @1.5 etc coefficient before.
About the whitespaces, they are created due to automatic scaling, which is set up to letterbox.
What letterbox does is it takes logical dimensions and apply them so they fit the screen while maintaining the aspect ratio, thus in some resolutions creating whitespaces (either vertical or horizontal, based on aspect ratio of current resolution)
I just wanted to know why there was white space in everything other than iPhone and using that example what image sizes can I use to achieve the same result without any white space.
After all if "Automatic Image Resolution" is touted as a feature, then it should work. Unfortunately the example project does not work, without additional code to reposition images and that makes the feature useless if I have to manage different resolutions by myself.
Given that there is also Automatic scaling I have tested the example and none of the options work properly. Setting no scaling puts the image at 0,0 but never uses the higher resolution images.
However @hgvyas123 answer which points to a topic on your site which mentions this white space and mentions how to add extra code to handle this.
Thanks
And whitespaces are due to scaling, it has nothing to do with image resolution and automatic image change. That's why I told that you are confusing both of these things.
So both feature (image resolution and screen scaling) work in that example, whitespaces are only consequences of letterbox scaling.
And yes, you can either change scaling to some other as crop or stretch to find suitable, or use absolute positioning of images in the post above.
so?
i note that for the non-menu parts 'no scale' mode is essential, so i cannot change to other scale modes.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://docs.giderosmobile.com/automatic_image_resolution.html
Automatic image resolution is directly related to automatic screen scaling.
Tell me why no scale mode is essential for other parts, maybe we can figure out something else?
i don't want to go into details, but then at this stage it will be much simpler to make some manual auto image resolution for the menu elements instead.
In a nutshell, I'm making a memory-game like game, although different in many ways. In any case I'm filling the whole screen as much as possible with a board of cards. Also i leave 1 pixel gap between them as it somehow looks sleek. And all of this works as i expect, so now changing this to automatic scaling would just mess up things.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
And manual resolution choosing is also simple to implement i think, so i don't mind much that i cannot use a.i.r.
Fragmenter - animated loop machine and IKONOMIKON - the memory game