:: PlayerAdvance.org ::  

Précédent   :: PlayerAdvance.org :: > :: Forums Hébergés :: > µLibrary

µLibrary Official µLibrary forum (English / Français)

Publicité

Réponse
 
Outils de la discussion Modes d'affichage
Vieux 30/12/2008, 00h52   #1
lumley
 
Messages: n/a
Par défaut 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);

ulDrawImage(this->img[this->stage]);

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.

Merci d'avance!!
  Réponse avec citation

Publicité

Vieux 31/12/2008, 00h45   #2
Yodajr
Administrateur
 
Date d'inscription: 09/11/2005
Messages: 3 750
Par défaut

Essaye de "realizer" toi même tes images, sans attendre le ul_DrawImage.
Yodajr est déconnecté   Réponse avec citation
Vieux 31/12/2008, 02h17   #3
lumley
 
Messages: n/a
Par défaut

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:
ul_RealizeImage(..);
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
ul_Draw...;

Dernière modification par lumley ; 31/12/2008 à 02h24.
  Réponse avec citation
Réponse

Liens sociaux

Publicité



Utilisateurs regardant la discussion actuelle : 1 (0 membre(s) et 1 invité(s))
 
Outils de la discussion
Modes d'affichage

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Navigation rapide

Discussions similaires
Discussion Auteur Forum Réponses Dernier message
µLibrary Aide Drawing texture ontop of another ambranera µLibrary 2 18/12/2008 21h05
A problem with image drawing, and a question. Netaro Aide au développement 2 05/10/2007 19h13


Fuseau horaire GMT +2. Il est actuellement 12h12.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd. Tous droits réservés.
Version française #16 par l'association vBulletin francophone
Design par Ass-Itch, DJP et Dr.Vince