:: PlayerAdvance.org ::  

Pr嶰嶮ent   :: PlayerAdvance.org :: > :: Forums H嶵erg廥 :: > 無ibrary

無ibrary Official 無ibrary forum (English / Fran蓷is)

Publicit

R廧onse
 
Outils de la discussion Modes d'affichage
Vieux 26/08/2009, 10h03   #1
BlueFrenzy
Newbie
 
Date d'inscription: 26/08/2009
Messages: 1
Par d嶨aut Quick questions about sprites

Hello. I started using this library to port my game to DS and I have some questions about the sprites manipulation. I will be glad if you post some code example ^_^

-How to read transparent pixels? In my pc application I use 24bit bmps. I converted it into gif and loaded into the application to use it as 8bit pallete (256 colours). I used the magenta colour RGB15(31,0,31) as transparent and the lib converted it fine.

But now I need to read those transparent pixels to make collision masks. If it's transparent, it should return false, else, return true.

-Is it faster to have a map collision or read directly the pixel when required? Due to DS limits, I wonder if it's better to read the pixel when detecting collision or instead create an array of data with the collision information.

-How to read image's width and height? I need to know the real size in pixels of the image. I load the image through my own filesystem so I have the gif or png directly loaded in memory.

-How to change the pallete colours? At some point I have to edit the pallete to change some colours. I know that I can "lock" the image's pallete but stil don't know how to change the colour.

-Is there any add or substract blending effect? I will be glad if i had those.

-Is there any possibility of having a gradient with transparencies? Like having a rectangle from black to completely transparent.


Thanks in advance
BlueFrenzy est d嶰onnect   R廧onse avec citation

Publicit

Vieux 26/08/2009, 20h43   #2
Monsieur J
Membre confirm
 
Date d'inscription: 19/03/2009
Localisation: Dijon, Paris
Messages: 124
Voir les codes amis Nintendo DS Voir les codes amis Wii
Par d嶨aut

Hello.

You won't regret to develop with microlib

To define transparent pixels, it's very easy.
Just put the function ulSetTransparentColor(RGB15(31, 0, 31)); before your drawing code.

I really advise you using a map for collides. I believe it's a better solution, easier and economic in memory.

The height and width of images are stored in UL_IMAGE struct. Attributes are sizeX and sizeY.

Sorry about palette colours. I don't know. I never tried modify its. But i think you can do it using GbaGraphics from Brunni.

Don't know regarding blending effect.
I don't think so regarding gradient transparency.

Brunni could answer for the last two subjects.

I hope this could help you.
Have a nice time developing your game with microlib!
Monsieur J est d嶰onnect   R廧onse avec citation
R廧onse

Liens sociaux

Publicit



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

R銶les de messages
Vous ne pouvez pas cr嶪r de nouvelles discussions
Vous ne pouvez pas envoyer des r廧onses
Vous ne pouvez pas envoyer des pi鋃es jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activ嶪s : oui
Les smileys sont activ廥 : oui
La balise [IMG] est activ嶪 : oui
Le code HTML peut 皻re employ : non
Navigation rapide

Discussions similaires
Discussion Auteur Forum R廧onses Dernier message
NDS PAlib et sprites 3D Jocker Aide au d憝eloppement 2 05/02/2008 00h25
NDS Multiplexage de sprites MsK` Tutoriels 29 31/12/2007 13h51
[DEV] Des Sprites pour vos Projets omg Tutoriels 30 31/10/2006 16h44
GBA Afficher des scores avec ses propres sprites Bobby Sixkilla Tutoriels 0 19/09/2006 00h12
NDS Questions sur les sprites et backgrounds Krazplay Aide au d憝eloppement 7 23/01/2006 00h45


Fuseau horaire GMT +2. Il est actuellement 14h42.


丼it par : vBulletin® version 3.7.2
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd. Tous droits r廥erv廥.
Version fran蓷ise #16 par l'association vBulletin francophone
Design par Ass-Itch, DJP et Dr.Vince