I need to move about 20 objects, so I made new group for them and move the group as I need…
This group is inserted in my main group…
But there are 2 object with images which moved correctly, but the others objects which are rects created with:
rect1 = display.newRect(200,100,40, 40);
Are still in the same positions…
I need to move this group only for 5px to right, but “rects” stay in the same place as before… why?
local localGroup = display.newGroup();
localGroup.x = 0;
localGroup.y = 0;
local rectGroup = display.newGroup();
rectGroup.x = 5;
-- There are some objects in localgroup
platform = display.newImageRect("images/platform.png", 390, 61);
platform.x = 234; platform.y = 260;
--slot01
rect01 = display.newRect(200,100,40, 40);
rect01.x = 82; rect01.y = 87;
--slot02
rect02 = display.newRect(200,100,40, 40);
rect02.x = 135; rect02.y = 87;
--[[
More rects created the same way here...
--]]
localGroup:insert(rectGroup);
rectGroup:insert(rect01);
rectGroup:insert(rect02);
rectGroup:insert(platform);
Platform moves correctly with position of “rectGroup”, but rects stay still on the same place… [import]uid: 59968 topic_id: 20765 reply_id: 81671[/import]