Good evening everyone,
I have a problem to compare the scale of a grid to a value. I Would like that if the size of a very special cell is greater than 1.5 then I deploy a gray rectangle.
The problem is that it does not recognize the progression of a cell of the grid via the transition.scaleTo … What should I write for this to be interpreted correctly?
thank you for testing and for your help
Â
display.setStatusBar( display.HiddenStatusBar ) grid = {} local colonnes = 10 local lignes = 15 local rectx = 30 local recty = 30 local espacement = 2 local ecartgauche =10 local ecarthaut = 50 for i = 1, lignes do grid[i] = {}; for k = 1, colonnes do grid[i][k] = display.newCircle(100,100,50,50) grid[i][k].yScale=0.2 grid[i][k].xScale=0.2 grid[i][k].alpha = 1 grid[i][k].x = (k - 1) \* (rectx + espacement) + ecartgauche grid[i][k].y = (i - 1) \* (recty + espacement) + ecarthaut local tm = math.random(1500, 5500) transition.scaleBy(grid[i][k], {yScale=2, xScale=2, time=tm, delay=tm} ) end end --spawn a rectangle when the scale is upper than... local function comparesscale() print( grid[4][5].yScale ) if grid[4][5].yScale \>= 0.3 then local rect=display.newRect(100,100,100,100) rect:setFillColor( 0.5 ) end end comparesscale()