|
Post by nyergk on Jul 2, 2010 13:53:58 GMT -5
i m new in programmation basic4gl, and trying to working functions sprites, but there is a big problem. when i do a sprite and call a image .jpg, the blank around the sprite if affiched to!!! so there is not a piece of chess who is printed but a piece of chess like in a block of glace!!!
how erase the blank across the sprite and make it transparent???
i think it must done when the sprite image is create with a painting logiciel but i don't know how...
help!!!
|
|
|
Post by Adam on Jul 2, 2010 14:50:19 GMT -5
well, I think I may just understand what you are saying first download this Gimp then in gimp go to layer > transparency from there you can either add alpha channel (when you erase it goes transparent) or color to alpha. after this, do NOT save a .jpg, this file format doesnt support transparency. I recommend, for basic4gl, saving in the .bmp format because for some reason b4gl loads .bmps with transparency better than others (in my experience)
|
|
|
Post by nyergk on Jul 2, 2010 15:45:43 GMT -5
thanks, i try to erase using alpha channel, and i save it in .bmp or .png format, but it s seem doesn't work cause now the sprite doesn't appear at all on screen, or appear only partially... dim img_abeille,spr_abeille
img_abeille=loadtexture("abeille.bmp") spr_abeille=newsprite(img_abeille)
bindsprite(spr_abeille) sprsetpos(320,240)
do sprsetpos(mouse_x()*640,mouse_y()*480) loop until mouse_button(0)<>0
|
|
|
Post by Adam on Jul 2, 2010 16:18:24 GMT -5
you dont want to use loadtexture (its old and the image size has to be a power of two) use loadtex instead
|
|
|
Post by Adam on Jul 2, 2010 18:21:19 GMT -5
If that didnt work could you upload your image and i will see what i can do?
|
|
|
Post by nyergk on Jul 3, 2010 7:52:27 GMT -5
THANK YOU!!!
now the programs work well, just have definited white like transparent color and it s all right!
|
|