2
0

2DTransforms.lua 489 B

12345678910111213141516171819
  1. -- Simple example showing how to move, scale and rotate 2d entities
  2. scene = Scene(Scene.SCENE_2D)
  3. scene:getActiveCamera():setOrthoSize(640, 480)
  4. for i=0,9 do
  5. image = SceneImage("Resources/polycode_logo.png")
  6. scene:addChild(image)
  7. -- Set the image position
  8. image:setPosition((30*i), 0)
  9. -- Rotate the image. You can alternatively call image:setPosition(45 * i)
  10. image:setRoll(45 * i)
  11. -- Set the image scale.
  12. image:setScale(1.0-(0.1*i),1.0-(0.1*i))
  13. end