Let's say there are two devices - 4" smartphone A and 10" tablet B. If A and B have same screen resolution, will Gideros treat them in the same way? If I want the button to be 20 mm (real-world mm) on both devices, can I achieve this with Gideros?
Well, if the resolution is the same, but dimensions of device in real world are different than the size of the button in real world, would also be different. As the scaling is proportional, at least Letterbox is.
I haven't tried to achieve this, but there is a function:
application:getScreenDensity()
Which should return the screen density in pixels per inch. You could use that to calculate the button size yourself
Ok, so can I use getScreenDensity together with setLogicalDimensions and both ASS and Automatic Image Resolution will work? Is AIR ok with logical dimensions set at runtime?
As I said I haven't tried that, but theoretically yes, you should be able to calculate the real dimensions. The way you calculate it will depend on what exactly ASS you will be using.
I'm not confident that every manufacturer's device will return a value.
Does the following code return a value on your mobile device; or does it display "Pixel Density Unknown"?
It would be very helpful if many people would run the following code on as many different devices (not simulators) as possible, and report the results in this thread.
local densityEnquirer = application:getScreenDensity()local words = TextField.new(nil, "Pixel Density Unknown")
words:setPosition(107, 222)
stage:addChild(words)if densityEnquirer then
words:setText(densityEnquirer.." pixels per inch")end
Kate's Catalogue of Travelling Theatre Centres : Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour. She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
@Platypus I think that nil value is only for desktop pcs and Macs (and maybe some other future platforms), all devices that I know (Android and IOS) return screen density
(Off topic: By the way, did you submit your thesis?)
Kate's Catalogue of Travelling Theatre Centres : Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour. She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
Kate's Catalogue of Travelling Theatre Centres : Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour. She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
Comments
I haven't tried to achieve this, but there is a function:
Likes: cubuspl42
What do you mean by AIR?
Likes: cubuspl42
Likes: Platypus
Yes I think it should be cool with that
Likes: cubuspl42
Does the following code return a value on your mobile device;
or does it display "Pixel Density Unknown"?
It would be very helpful if many people would run the following code on as many different devices (not simulators) as possible, and report the results in this thread.
Likes: cubuspl42
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
That's good news. Thanks.
(Off topic: By the way, did you submit your thesis?)
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.