Hi, i’ve made a map with tiled, composed by 2 layers, one tile and one object with many static objects.
When i rotate the map with the command map.world.rotation = (xx), the tile layer rotate properly, but the statics objects doesn’t rotate, they just shift holding just one point (maybe the center).
here is the code if you want to try, it’s really strange.
display.setStatusBar( display.HiddenStatusBar )
local ui = require("ui")
require("physics")
physics.start()
-- Create a background colour just to make the map look a little nicer
local back = display.newRect(0, 0, display.contentWidth, display.contentHeight)
back:setFillColor(165, 210, 255)
-- Load Lime
local lime = require("lime")
-- Load your map
local map = lime.loadMap("primamappamostri2 copy 2.tmx")
local visual = lime.createVisual(map)
-- Build the physical
local physical = lime.buildPhysical(map)
-- local angleMag = event.magnetic
map.world.rotation = 0
try to put the deg in the last line. Please help me!! [import]uid: 30837 topic_id: 6768 reply_id: 306768[/import]
This seems to be down to a limitation with Box2D and having physics bodies in different groups - http://developer.anscamobile.com/forum/2010/09/17/moving-objects-group-collision - this could be a problem. I will get back to you after I have tried the solution they have put forward. [import]uid: 5833 topic_id: 6768 reply_id: 23621[/import]
Is it possible to add one anchor point through the map and the static objects?
This could be a solution, no?
Thanx [import]uid: 30837 topic_id: 6768 reply_id: 24223[/import]
Hey, sorry was away all weekend but am back at my PC now. I believe the issue is to do with the Physics bodies being in separate groups to everything else, I may have read about an issue with this. Does anyone have a link to what I might have seen? [import]uid: 5833 topic_id: 6768 reply_id: 27851[/import]