I think this xLIBC function is what you're after: http://dcs.cemetech.net/index.php/DCSE:BasicLibs:DrawSprite#DrawSpriteTileBGA_.28TIOS_Values.29

This draws a small section of the tilemap as required (to restore a map after drawing a sprite).
PT_ wrote:
and what i have said in another post: how can i draw only 1 or 2 tiles of the tilemap, at the place where the sprite was?
but tanx!@!!!!
Since you already have your sprites loaded into memory (via real(5,0,0)), you can use the DrawSprite functions to draw single sprites (or a few sprites) into the GRAM. Does that make sense, or would you like me to elaborate further?

Edit: I didn't see tr1p1ea's post on the second page. My mistake.
oke, now i have this code:

Code:

"98423106540854620132125665409460"->Str8 //Random
real(0,1,1,0)
real(3,0,0,0,20,8,0,0,19,14,1
real(3,0,0,0,20,8,0,0,19,14,0
"HARDEST"
real(5,0,0)
real(1,1,0,80)
real(1,1,1,56)
real(1,1,2,80)
real(1,1,3,56)
Repeat real(2,0,0)=15
real(4,4,real(1,0,2),real(1,0,3),2,2,0,0,1,0,20,8)
real(4,1,0,1,1,1,0,0,255,1,0,0)
real(1,1,2,real(1,0,0))
real(1,1,3,real(1,0,1))
real(2,2,0,1,2,2)
End
real(0,3,4,255,1)
real(0,3,4,255,0)
real(0,1,0,1)


but when i move with my sprite, sometimes on the screen is a little black line flickering. how can i solve it?[/code]
There are 2 things that could affect it.

The first is that you are drawing the tilemap *before* loading any graphics data into memory. Now 1st run will result in random graphics, if nothing is changed and you run it a 2nd time the graphics should be loaded so could be alright. But still id move the lines around:


Code:
"HARDEST"
real(5,0,0)
real(3,0,0,0,20,8,0,0,19,14,1
real(3,0,0,0,20,8,0,0,19,14,0


The issue with the sprite drawing is that you have the sprite clearing around the wrong way. You are clearing the sprite on the *current* frame, but then redrawing over it with the updated position. This could lead to an overlap when updating the screen.

Try swapping these 2 lines:


Code:
real(4,1,0,1,1,1,0,0,255,1,0,0)
real(4,4,real(1,0,2),real(1,0,3),2,2,0,0,1,0,20,8)


See if that works.
*bump**bump**bump*
and something like this, why this will not work?

Code:

real(2,3,0,1,1,1,5,8,8,10,10,160,100)

my sprite cant move now and it is in the middle of the screen
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement