GP32 Transparencies


nihil-00

Member
Joined
Feb 9, 2003
Messages
110
Age
40
ok, so i know you can handle transparencies with sprites...

what about alpha?
when i directly draw to the screen, for example, can I draw a semi-transparent line?
 
There's no premade function for that yet in Mirko's SDK, and it probably won't be ever. ;)
It's quite simply to build one your own, get some Bresenham line algorithm to check each pixel for it's current colour, tint it and draw it.
 
and, in general?
for example, if i want to fill a small rectangle in the screen with some transparent colour, like it was some sort of "coloured glass" that change the colour of underlying images...
or, simply semi transparent draw routines (fill, point(,line)...), like the sprite example in the sdk does, but without the use of the sprites?
 
meh, for example 50/50-transparency:

look what color the pixel has, add it to the new color, divide them through 2 and you have the "semi-transparent" layer
for 1/3-transparency for example you have the first color being 2/3 and the second 1/3
you multiply the first with 2/3, the second with 1/3, add them to each other and have a 1/3-transparency

thats just theory :S

i'm not taking responsibility for further questions or not-working stuff ^^

edit: if you want to fill a 100% transparent rectangle onto the screen use this function: int nothing() { return(NULL); }
 
void gp_drawSpriteHTB( u16 *sprite, short put_x, short put_y, u16 *framebuffer, u16 trans,u8 alpha )


u8 alpha:

[0-31]: alphablending of sprite
[0]: sprite is not visible
[15]: 50% background,50% sprite
[31]: Sprite full visible

Mr. Mirko's SDK 0.8.5
 
Back
Top