Help..Invisible borders around objects.

Hi guys,

I have a game that im stacking crates. When i stack the crates on top of each other there seems to be an invisible border around each causing them to appear flouting…there are no borders around the actually images (in photoshop) so i have no idea why this is happening. I have attaced an image to show you.

Thanks

http://img163.imageshack.us/img163/3200/crategaps.jpg [import]uid: 162458 topic_id: 29036 reply_id: 329036[/import]

Are you using physics? How are you measuring the height of the crates? [import]uid: 41884 topic_id: 29036 reply_id: 116856[/import]

Turn on the hybrid draw mode for the physics engine.

[lua] physics.setDrawMode( “hybrid” )[/lua]

This will give you an overlay of the underlying physics object. When working with the physics engine I pretty much always leave this on as it it makes troubleshooting so much easier.

You most likely just need to adjust the size of the physics object attached to the crate by a pixel or 2. [import]uid: 147305 topic_id: 29036 reply_id: 116860[/import]

thanks guys…im using the code below to create the crate. Also iv turned on hybrid and can see a 1 pixel border around each crate, how would i eliminate this?

local cratebig = display.newImageRect( “crate.png”, 90, 90 ) [import]uid: 162458 topic_id: 29036 reply_id: 116862[/import]

The physics body is created when you use addBody, so that being the case below should work.

[lua]local cratebig = display.newImageRect( “crate.png”, 90, 90 )
–define the custom shape by plotting each corner. Goes in clockwise order, starting with upper left.
–0,0 is middle of object.
local crateShape = { -44,-44, 44,-44, 44,44, -44,44 }
–add body to crate using our crateShape!
physics.addBody( cratebig , { density=5.0, friction=0.1, bounce=0.1, shape=crateShape } )[/lua]

I think i am off with the crateShape X/Y positions and I don’t have Corona to check it atm but you should be able to play with it and get the desired effect.

[import]uid: 147305 topic_id: 29036 reply_id: 116868[/import]

Thanks very much for your help guys [import]uid: 162458 topic_id: 29036 reply_id: 117670[/import]