Drawing different animations
Hi! I'm sorry this post isn´t in French, I cannot speak it and I barely understand it. I'm quite new in NintendoDS programming and newer on using uLibrary.
Here are some problems I cannot overtake:
1) I'm making a fighting game, so I have a character with many animations, ovbiusly I cannot have them all on VRAM so I have different animations on different ".png" files. I load all animations on RAM, and I unrealize them when I want to draw a new animation (I know uLib realizes them automatically). Suposing I have two animations, "stay" and "jump", the "stay" animation plays repeatedly from the "stay.png" file, selecting the position I'd like to see by using:
/* select the piece of the complete image to draw */
ulSetImageTileSize(this->img[this->stage], 0, P_HEIGHT * this->stages[this->stage][this->anim], P_WIDTH, P_HEIGHT);
That works fine, when you press the "jump" button, I just change the stage and draw the "jump" animation. It all works fine but when I draw the new animation the screen flickers, when doing the Realization. It's just like the uLib documentation says but I was wandering if there was an alternativelly way to paint an Image on screen, maybe transforming it with "ulTexImage2D" but I don't know anything about textures.
Any information about how to resolve this problem would be great.
2) I'd like to draw lines and rectangles using uLib functions, the problem is that they always draw black, it doesn't matter if I use RGB15( R, G, function "ulDrawFillRect(0, 0, 256, 192, RGB15(0, 16, 31));", not even on uLibray examples works.
If somebody knows some answers please post them, I don't mind if they are in french.
Date d'inscription: 09/11/2005
Messages: 3 738
Essaye de "realizer" toi même tes images, sans attendre le ul_DrawImage.
Thank you Yodajr, but I've tried that before. I'd even tried making an occupied wait so that the screen wouldn't be drawn while the "realization".
(Using time functions)
while(time < start_realization_time + 1000 /*1 sec*/ ); // ; Do nothing
But I could notice its not a time fact, its just the VRAM lock because of the writing what made it flicker. Thats why I thought there maybe was a way of writing on VRAM without locking it, some kind of 3D optimisation.
Anyways, I really appreciate your answer, thanks again.
*Sorry, I should have mentioned the way I did it:
start_realization_time = Tick(time); // Get the exact milisecond the image has been realized
while(Tick(time) < start_realization_time + 1000 ) ; // The one second wait
Dernière modification par lumley ; 31/12/2008 à 01h24.
|Utilisateurs regardant la discussion actuelle : 1 (0 membre(s) et 1 invité(s))|
|Outils de la discussion|
|Drawing texture ontop of another||ambranera||µLibrary||2||18/12/2008 20h05|
|A problem with image drawing, and a question.||Netaro||Aide au développement||2||05/10/2007 19h13|