scaling for different screensize....

since my game is a shooting game that requires shooting in a delicate angle the size of the objects really matters a lot . However since there are various devices rith their own screen size  I had to figure a way to make the bullet objects and target objects size to be proportionally equal in every device

but my problem is that i can prepare multiple images but not  as much as the number of different resolutions out in the market(480*800 600*1024 800*1280 720*1280 etc.) so I found out there is a way to scale the object proportional to the screen size or resolution,

but heres whats bothering me, I have shallow knowledge about graphics softwares but still I know that scaling is quite of an intense process, and scaling an object every time I spawn an object just seems very inefficient, since most of the time the object I will be spawning would be an image identical to one of the ones that are existing, for example, an arrow that uses the same image again and again, 

is there a way to solve this proble?

p.s. nine out of ten topics I post never gets a single reply

so I’d really appreciate if someone would help for this once  : -)

and simply saying I don’t think there is a way… would also be of help since I can just quickly seek for

 other solutions

Hi there,

To make your objects proportionally sized on every device, you can use Corona’s dynamic scaling feature (http://docs.coronalabs.com/guide/basics/configSettings/index.html#dynamicscaling).  Have you given that a try?

As for efficiency when working with images, it sounds like you’re spawning, scaling, and later deleting the arrow image every time the arrow is shot.  If you only have one arrow on screen at a time, then more efficient would be to create an arrow display object just once.  When it’s time to “delete” it (maybe that’s after it hits the target), just set it’s isVisible property to false so it no longer shows on screen.  When it’s time to shoot another arrow, position the arrow object back to the starting point, and then set it’s isVisible property to true again.

Last, I’d mention that applying a scale factor to an image when you load it isn’t going to result in a big performance hit, so I wouldn’t worry about that.

Hope this helps.

  • Andrew

yeah, I guess maybe i was overthinking ., thanks

p.s. nine out of ten topics I post never gets a single reply

so I’d really appreciate if someone would help for this once  : -)

and simply saying I don’t think there is a way… would also be of help since I can just quickly seek for

 other solutions

Hi there,

To make your objects proportionally sized on every device, you can use Corona’s dynamic scaling feature (http://docs.coronalabs.com/guide/basics/configSettings/index.html#dynamicscaling).  Have you given that a try?

As for efficiency when working with images, it sounds like you’re spawning, scaling, and later deleting the arrow image every time the arrow is shot.  If you only have one arrow on screen at a time, then more efficient would be to create an arrow display object just once.  When it’s time to “delete” it (maybe that’s after it hits the target), just set it’s isVisible property to false so it no longer shows on screen.  When it’s time to shoot another arrow, position the arrow object back to the starting point, and then set it’s isVisible property to true again.

Last, I’d mention that applying a scale factor to an image when you load it isn’t going to result in a big performance hit, so I wouldn’t worry about that.

Hope this helps.

  • Andrew

yeah, I guess maybe i was overthinking ., thanks