{"issue":{"state":"open","created_at":"2011-11-30T08:00:53Z","updated_at":"2011-12-01T13:35:20Z","comments":5,"user":{"gravatar_id":"743cfc87fc98be68f0c4cafb01b11e2a","id":1130047,"url":"https://api.github.com/users/alexzheng","avatar_url":"https://secure.gravatar.com/avatar/743cfc87fc98be68f0c4cafb01b11e2a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"alexzheng"},"body":"I run the sample rapanui-samples/physics/rn-physics-lists and is report an error\r\n\r\nI look into the source \r\n\r\n--we need the layer from RNScene received\r\n--keep it in mind for future changes\r\nfunction setDebugDraw(screen)\r\n\r\n    local layerfordebug = screen.layer\r\n    len = table.getn(screen.sprites)\r\n    for i = 0, len, 1 do\r\n        screen.sprites[i].visible = false\r\n    end\r\n    layerfordebug:setBox2DWorld(world)\r\nend\r\n\r\ni should start from 1\r\n\r\n","assignee":{"gravatar_id":"57010b4a0aeb9cdff3c50866d980108f","id":744162,"url":"https://api.github.com/users/MattiaFortunati","avatar_url":"https://secure.gravatar.com/avatar/57010b4a0aeb9cdff3c50866d980108f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"MattiaFortunati"},"id":2398462,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":8,"title":"bug in setDebugDraw ","html_url":"https://github.com/eljeko/rapanui/issues/8","closed_at":null,"url":"https://api.github.com/repos/eljeko/rapanui/issues/8","milestone":null},"action":"created","comment":{"created_at":"2011-12-01T13:35:20Z","updated_at":"2011-12-01T13:35:20Z","user":{"gravatar_id":"57010b4a0aeb9cdff3c50866d980108f","id":744162,"url":"https://api.github.com/users/MattiaFortunati","avatar_url":"https://secure.gravatar.com/avatar/57010b4a0aeb9cdff3c50866d980108f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"MattiaFortunati"},"body":"Hi!\r\n\r\nYes you were right, they were added to two groups and then removed from only one of them...\r\nThat's because while coding scenes and director I forgot that RNFactory adds images in its mainGroup by default.\r\n\r\nI fixed some changes in scenes scripts that can resolve this:\r\nWe can avoid the default group:insert during factory:\r\n\r\n<code>tile1a = RNFactory.createImage(\"images/tile1.png\",{parentGroup=mainGroup});tile1a.x=160;tile1a.y=240;</code>\r\n\r\n(like in scene1.lua and scene2.lua)\r\n\r\nor we can remove childs from the default group later\r\n\r\n<code>for i=1,table.getn(RNFactory.mainGroup.displayObjects),1 do\r\n\t\tRNFactory.mainGroup:removeChild(1);\r\nend</code>\r\n\r\n\r\n(like for scene3.lua and scene4.lua)\r\n\r\nThis should remove completely the images from any group or reference.\r\n\r\nWe are currently working on memory management, so thank you for having discovered this and let me know if you have other problems.\r\n\r\nThank you again ^^\r\n\r\nMattia\r\n\r\n","id":2974732,"url":"https://api.github.com/repos/eljeko/rapanui/issues/comments/2974732"}}