Question: Fixed width and height or calculate it base on screen dimensions?

Hi guys,

I wanna hear your opinion about this. Is it safe to use it?

from like this:

[lua]

fPic = display.newImageRect(“pic.png”,150 , 160 )

[/lua]

this one is fixed based no matter what device you build on.

to this:

[lua]

Pic = display.newImageRect(“pic.png”,display.viewableContentWidth * .073 ,display.viewableContentWidth * .13)

[/lua]

this one changes its width and height based on the device you are building.

I’m personally using this because its more like dynamic, but I don’t know if it has any drawbacks if my app is installed on devices. (I can only build on android, I don’t have a developer account on Apple so I can’t test how it looks)

And I used this dynamic approach on the x and y location of an objects too.

Is there any pro and cons using this approach? does it affect the dynamic image selection?

Please enlighten me :slight_smile:

Thanks in advance,

Jam

The correct answer here is probably “it depends” :)    </snarky>

Fixed size:  pros=you know what you get/no stretching of the image; cons=on some screens the image is 25% of the display while on others it is 5%

Dynamic size:  pros=it looks “good” on all/most platforms; cons=it may not look “best” on any platform

But maybe some clarification to your question would be helpful:  what is your target audience or target device?  do you want to target multiple devices?  Is this the only display object on the screen or not?  does this display object “interact with”, or need to be sized/positioned with, other objects?  especially, is there any text on the screen with it?  (text can’t be too small or it is unreadable, so your image may need to adjust to be proportional, e.g.)

Hi, thanks for the reply. I’m planning on releasing it on App Store and play store. (The company will provide all what I need.) I’m currently using it all on my objects on the screen some have collisions going on, except for the text size, but the text’s x and y position is dynamically positioned too. I use the modified config file where the width and height of the screen is calculated( not the fix 320x480 something).

@Jam,

Hi guys,

android, I don’t have a developer account on Apple so I can’t test how it looks )

Note: You can test how your app will look with the many devices in the simulator. 

Trying your app on these simulated devices will give you at least gross feedback on design decisions without having to install on a device.

I did check them all. So far so good. But I’m asking about is it a good approach? All of the objects width, height, x, and y parameters is based on the screen size rather than the fixed one.

Well, I mostly believe in a “to each his own” approach, but I personally think it is a bad approach because it becomes very complex to design that way once you get a ways down the road.

I personally like to set one design resolution using config.lua and then let Corona do the scaling for me.  

Please see my response to this recent thread: http://forums.coronalabs.com/topic/49228-dynamic-image-size-for-all-ios-devices/

Thanks for the advice roaminggamer. 

yeah I find it hard to position my objects using the dynamic method since you have to do some maths to position them thats the major drawback. I’ll stay away from it if I can find a work around with it. 

The correct answer here is probably “it depends” :)    </snarky>

Fixed size:  pros=you know what you get/no stretching of the image; cons=on some screens the image is 25% of the display while on others it is 5%

Dynamic size:  pros=it looks “good” on all/most platforms; cons=it may not look “best” on any platform

But maybe some clarification to your question would be helpful:  what is your target audience or target device?  do you want to target multiple devices?  Is this the only display object on the screen or not?  does this display object “interact with”, or need to be sized/positioned with, other objects?  especially, is there any text on the screen with it?  (text can’t be too small or it is unreadable, so your image may need to adjust to be proportional, e.g.)

Hi, thanks for the reply. I’m planning on releasing it on App Store and play store. (The company will provide all what I need.) I’m currently using it all on my objects on the screen some have collisions going on, except for the text size, but the text’s x and y position is dynamically positioned too. I use the modified config file where the width and height of the screen is calculated( not the fix 320x480 something).

@Jam,

Hi guys,

android, I don’t have a developer account on Apple so I can’t test how it looks )

Note: You can test how your app will look with the many devices in the simulator. 

Trying your app on these simulated devices will give you at least gross feedback on design decisions without having to install on a device.

I did check them all. So far so good. But I’m asking about is it a good approach? All of the objects width, height, x, and y parameters is based on the screen size rather than the fixed one.

Well, I mostly believe in a “to each his own” approach, but I personally think it is a bad approach because it becomes very complex to design that way once you get a ways down the road.

I personally like to set one design resolution using config.lua and then let Corona do the scaling for me.  

Please see my response to this recent thread: http://forums.coronalabs.com/topic/49228-dynamic-image-size-for-all-ios-devices/

Thanks for the advice roaminggamer. 

yeah I find it hard to position my objects using the dynamic method since you have to do some maths to position them thats the major drawback. I’ll stay away from it if I can find a work around with it.