DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

Tiled (map editor) layer offset problem #1448

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create simple a tiled project with 1 layer. (Tiled 0.8.1)
2. Create a simple xCode/coco2d (v2) project I use the "IntroLayer" form the 
template but not the "HelloWorld"
3. Load the assests into the project , and instantiate the TileMap and layer 
into the program
4. Build.

What is the expected output? 
When I run the program the tile map should display correctly.

What do you see instead?
When I run the program,  the layer renders but is incorrectly shifted to the 
left by 1 column. When I programmatically position the layer to the right 
(where is should be) the tiles in the first column are missing. 

What cocos2d version are you using ?
cocos2D v2

What iOS / Mac SDK are you using ?
xCode 4.5.1

Debug or Release ?
It says Release (not sure?)

Which target device / target OS are you using ?
iPhone 4

iOS only: Does this happens on device ? or on the simulator ? or on both ?
Both

Mac only: x86 or i386 ?
OSX 01.8.2 (Mountain Lion) MacBook Pro

Please provide any additional information below.
The object layers position is correct. Subsequent layers are sometimes 
correct?? Yes, sometimes. When I made a layer for collision tiles, its position 
was correct when I build. But if I made a full Texture map layer it's position 
was incorrectly offset.

Original issue reported on code.google.com by lawrence...@yahoo.com on 5 Dec 2012 at 11:15

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ricardoq...@gmail.com on 21 Dec 2012 at 7:07

GoogleCodeExporter commented 9 years ago
Thanks.
I tested on v2.0 and I could reproduce your issue.
I tested with v2.1 and it was already fixed.

fixed.

Original comment by ricardoq...@gmail.com on 7 Jan 2013 at 10:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thnx Ricardo, 
That worked for me.

Original comment by lawrence...@yahoo.com on 13 Jan 2013 at 7:44

GoogleCodeExporter commented 9 years ago
Hey Ricardo, There's still a similar problem. let me know if your still open to 
this ticket. 
When I add another layer (for collision blocks) , the new layer is offset by 1 
row shifted up. 
Visually the block image loads correctly but the collision function is offset.

Here the code sorry for the small mess, it's just a test project

You will see the location of the collide image hexagon is correct from .tmx , 
but the collision is 1 row up, incorrect. 

Original comment by lawrence...@yahoo.com on 15 Jan 2013 at 6:00

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. Reopening ticket.

Original comment by ricardoq...@gmail.com on 15 Jan 2013 at 6:20

GoogleCodeExporter commented 9 years ago
btw my work around is to offset the layer before I save/export.
1. In tiled, setup the my placement of the "collision layer" tiles.
2. Then offset (Map>OffsetMap...) to +1 unit (down), for only that layer. 
3. Then save (export to xCode). 

To re-edit the tmx. I offset the -1(re-setting it back to the default) then 
edit.... then work around again.
Also I will turn off visibility for the collision layer for release builds. 
Thanks for your help.

Original comment by lawrence...@yahoo.com on 15 Jan 2013 at 7:15