When I use TMXTileMap, I notice there are straight white lines appear every time when I use MoveTo actions to move the map but on Simulator no white line appear. anyone notice it?
TMXTileMap bug (White Line On Device normal on Simulator)
(14 posts) (6 voices)-
Posted 2 years ago #
-
I don't have that issue, though I don't use actions - I set the position manually as the player moves.
Do you only see it as the action is happening, or do they persist after an action is performed?
Posted 2 years ago # -
I need to use moveTo to move my map when the character move, if i use setPosition it goes very fast. I want to have animation like MoveTo.
It only occur when the action is happening and the white lines disappear after the action stopped. Imagine: it's something like you watching an old movie with white Line appear on the screen. I have the latest iPod firmware.
Posted 2 years ago # -
Sorry, I wasn't trying to dispute your approach if that's how it sounded - just clarifying that I haven't experienced it under my circumstances. =)
Maybe check this thread for ideas? It's the closest I can think of to the problem you describe, though it's not spot-on either.
Posted 2 years ago # -
I haven't solve it yet. Maybe there's another way ? I used 2D projection as mentioned by Steve on the link above but the white line still appear. Only occur on device not simulator
Posted 2 years ago # -
It's probably artifacts/glitches with TMX tile maps. I don't think it's a bug, but rather there are steps you need to do to ensure the problems don't happen. There's a lot of posts on the subject so it's best if you search and read each one to see if you can find a method to solve it.
The general tips are:
Set 2D Projection in the Director
Set Alias Parameter for the Tile map (instead of Anti-Alias)
If you're updating the camera center/eye, try round your input to an integer instead of passing in a float
Disabling Render Subpixel may work as wellPosted 2 years ago # -
In this page:
http://basic4gl.wikispaces.com/2D+Drawing+in+OpenGLthey recommend doing an small translation before the rendering.
glTranslate(0.375f, 0.375f,0)Posted 2 years ago # -
I'm very interested in testing that riq, but I'm not sure where I should place it. Can you give some hints as to where I should be placing that glTranslate?
Posted 2 years ago # -
@edisonlabs: you can place on the
TMXLayer#draw.eg:
-(void) draw { glTranslatef(0.375f, 0.375f,0); [super draw]; glTranslate(-0.375f, -0.375f,0); }You can extended the
TMXLayerclass... there is no need to modify the cocos2d sources... but if it is easier for you, you can modify the sources too.Posted 2 years ago # -
I see, thanks.
Unfortunately, it doesn't seem to do much for me. Actually it ended up adding flickers back into my game, lol. My problem is slightly different from the original poster here though.
I resolved my previous flickering/glitching issues of the TileMap by following the 4 tips I posted above earlier. However, if I zoom out of the tile map (by changing the eye of the camera), the glitches come back, and there's no way of fixing it. If I set the camera back to its eyes original Z value (415.0f), the glitches go away.
It baffles me as to why changing the Z value of the eye of the camera would cause glitches to come back. If anyone has any tips, it would be much appreciated.
Posted 2 years ago # -
@edison:
- try to generate mipmaps images.
// obtain the texture of the texture int texture_id = [texture name]; glBindTexture( GL_TEXTURE_2D, texture_id ); glGenerateMipmapOES(GL_TEXTURE_2D);- and/or use the 'artifact fixer': http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps#how_to_create_external_tilesets
Posted 2 years ago # -
Allright I got the solution, The device's pixel is more precise than the simulator (maybe), My tileset.png contains a white background layer and it has one pixel missing on the bottom and that is why the white line appear. So I try to I redraw again the tileset; extending the missing pixel :D. It works! HEHEHE... thanks for your help. I learned so much things from you guys.
Posted 2 years ago # -
try this:
its work!
XMAP.scaleY=0.999f;
XMAP.scaleX=1.000f;
XMAP.position=ccp(0.0f,1.1f);Posted 1 year ago #
Reply
You must log in to post.