2016-04-10 31 views
0
Burada Görüntü yarattı

:Corona: Bunu oluşturduktan sonra Görüntüyü ölçeklemek nasıl

gangster = display.newImageRect("assets/gangsta.png", gangsterwidth, gangsterheight) 
gangster.x = display.contentCenterX 
gangster.y = 950 
sceneGroup:insert(gangster) 

Ve ben burayı ayarladıktan sonra şimdi Image ölçeklemek istiyorum:

local function enterFrameListener() 
    if holding then 
     if (touchx < gangster.x) then 
      gangster.x = gangster.x - 10 

     end 
      if (touchx > gangster.x) then 
      gangster.x = gangster.x + 10 

     end 
       if (touchy > gangster.y) then 
      gangster.y = gangster.y + 10 
      -- INCREASE HEIGHT AND WIDTHHERE 

     end 
       if (touchy < gangster.y) then 
      gangster.y = gangster.y - 10 
      gangsterheight = gangsterheight -5 
      -- DECREASE HEIGHT AND WIDTH HERE 

     end 
     if (touchx == gangster.x) then 
      if (touchy == gangster.y) then 
     Runtime:removeEventListener("enterFrame", enterFrameListener) 
     holding = false 
     end 
     end 
    else 
    end 
end 

Ama nasıl bunu yapıyorum

cevap

2

Görüntüleme nesnelerinin ölçek yöntemi vardır. Sizin durumunuzda,

+0

Omg Ben sadece aptal yerine kullanıyorum: yerine. . Teşekkür ederim! – AlGrande