Sprite transformation artefact

Hi,

when I move a sprite with a transition then there appears an artifact.
So if I move a sprite to the left side then on the right side of the sprite there sometimes appears on horizontal line of the next frame.

Here is a code to show you the problem:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local sprite = require("sprite")
 
 
display.setStatusBar( display.HiddenStatusBar )
local background = display.newRect(0,0,display.contentWidth,display.contentHeight)
background:setFillColor(255,255,255,255)
 
        
local spriteSheet = sprite.newSpriteSheet("sprite.png",60,60)
local spriteSet = sprite.newSpriteSet(spriteSheet,1,2)
 
sprite.add(spriteSet,"test",1,2,2000,1)
 
 
local object = sprite.newSprite(spriteSet)
object:prepare("test")
object:play()
object.x = 200
object.y = 200
 
 
transition.to(object,{x=50,time=1000})

This sounds like an openGL rendering artifact where the texture edge can wrap around to the other side of the polygon it's being rendered on. Try adding a 1-2 pixel transparent border around your sprite texture and see if the artifact goes away.

Hi XenonBL,

Thank you this helped, although I now have to set the frame sizes and positions manually.

views:1506 update:2011/10/11 22:13:38
corona forums © 2003-2011