Transparent Sprite Persistance Problem!!
Posted: Wed Jun 14, 2006 9:31 pm
I am writing a program to plot a graph of some values in an array. For this I have created two sprites, one contains a grid while the other is used for plotting the data points. I have used two sprites to increase the speed of plotting as I dont have to draw grid everytime the plot loop is executed.
Now the problem is that in the transparent sprite, the old poltted data persists even after the new data is plotted creating a mess on the screen. How do I clear old plotted data?
Here is my code
The grid sprite is displayed once when the program starts.
Any solution?
Now the problem is that in the transparent sprite, the old poltted data persists even after the new data is plotted creating a mess on the screen. How do I clear old plotted data?
Here is my code
Code: Select all
Procedure DisplayData()
Define x.w
Define old_y1.w, new_y1.w
Define old_y2.w, new_y2.w
Define new_sprite.l
StartDrawing(SpriteOutput(1)) ;Starts Drawing on the sprite
Box(0,0,512,320,$000000)
old_y1 = 128
old_y2 = 128
DrawingMode(#PB_2DDrawing_Transparent) ; sets Text background transparent
For x=0 To 511
new_y1 = Read_buff(x)
new_y2 = Read_buff(x+512)
LineXY(x-1, old_y1, x, new_y1,#Red)
LineXY(x-1, old_y2, x, new_y2,#Green)
old_y1 = new_y1
old_y2 = new_y2
Next
StopDrawing() ;Stops drawing on the sprite
FlipBuffers()
DisplayTransparentSprite(1,0,0) ; display the sprite
EndProcedure
Any solution?