On Wed, Sep 17, 2008 at 10:14 PM, Ragzouken <[EMAIL PROTECTED]> wrote:
>
> I have a tilemap of tiled, textured quads. When I used glRotate
> (within a group) to rotate that map, my tiles show seams, and I think
> even adjacent pixels in the texture start to show up in tiles where
> they shouldn't be. Here is an example: 
> http://dump.ragzouken.com/Screenshot.png
>
> Is it possible to easily fix this? I don't need rotation that badly,
> but it would be nice to have for completeness.

Add 1 pixel of padding between adjacent images in a texture.  The
padding should be the same colour as the border colour.
pyglet.resource.image/TextureAtlas don't currently do this because
this kind of image manipulation isn't really supported by pyglet; and
it's easy to pad the images yourself.  The following monkey patch will
also automatically add padding, but is only correct if your images
have 0 alpha at the border:


def _texture_atlas_add(self, img):
    pad = 1
    x, y = self.allocator.alloc(img.width + pad * 2, img.height + pad * 2)
    self.texture.blit_into(img, x + pad, y + pad, 0)
    region = self.texture.get_region(x + pad, y + pad, img.width, img.height)
    return region
pyglet.image.atlas.TextureAtlas.add = _texture_atlas_add


Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to