zoomstretch

Is there a way to stretch just the background image and nothing else? [import]uid: 82446 topic_id: 22146 reply_id: 322146[/import]

object:scale( sx, sy )  

http://developer.anscamobile.com/content/displaynewimagerect

or

object = display.newImageRect( [parentGroup,] filename [, baseDirectory] width, height )  

http://developer.anscamobile.com/reference/index/objectscale

I prefer using the second option. But, if you need to scale the background more than once then use scale. [import]uid: 38820 topic_id: 22146 reply_id: 88076[/import]

You could also scale image by using

local value = 1.5  
object.xScale = value  
object.yScale = value  

http://developer.anscamobile.com/node/2429
http://developer.anscamobile.com/node/2438
[import]uid: 38820 topic_id: 22146 reply_id: 88077[/import]

Thanks for the help friends…I am using
display.newImageRect
in my program…What I want now is that other images to be as it is.they should not stretch…What should I do? [import]uid: 82446 topic_id: 22146 reply_id: 88078[/import]

You could scale each image or…

You could insert all your objects into a display group and just scale the display group. For example if you wanted to scale the background image and all objects you could do the following.

local scale = 1  
local myGroup = display.newGroup()  
  
local background = display.newImageRect( "background.png", 800, 480 )  
myGroup:insert( background )  
  
local object1 = display.newImageRect( "object1.png", 128, 200 )  
myGroup:insert( object1 )  
   
local object2 = display.newImageRect( "object2.png", 48, 48 )  
myGroup:insert( object2 )  
  
local object3 = display.newImageRect( "object3.png", 200, 36 )  
myGroup:insert( object3 )  
  
scale = 1.25  
myGroup.xScale = scale   
myGroup.yScale = scale  

[import]uid: 38820 topic_id: 22146 reply_id: 88080[/import]

http://www.base2solutions.com/walkabout/Corona%20Tips.html

section 3.

You can use:

zoomStretch = display.newImageRect( “Title.jpg”,
display.contentWidth - display.screenOriginX*2,
display.contentHeight - display.screenOriginY*2)

This is better than scaling, as it’ll load the largest image it can using dynamic scaling. I advise you to read section 3 to understand the best way to acheive this :slight_smile: [import]uid: 8872 topic_id: 22146 reply_id: 88087[/import]