hi
this is what happens when i use x_sprite with a png
why is the antialias to black? and not to transperent
[attachment deleted by admin]
When you create the PNG, make sure the paint package does proper 8 bit transparency, not 1 bit. If the image you create in the paint package has a black background and you use AA to get a smoth edge, the transparency will have black mixed in it. You need to make a real transparent background, usually visible in the paint program as a light-gray/white checkerboard in the background.
If all this is correct you might want to set alphamode to something else than 0, not sure if this impacts x_sprite though?
edit: Also if you use Photoshop to save the png, make sure you export it for web and select transparency.
i made i with photoshop and nothing works :) even the pink transperent bmp background comes out ugly like this
any ideas?
10x
Hm. You should make that image totally green and only control the transparency using the alpha channel (use Photopaint or so). Also, make the texture a power of 2 in sizes, or i'll have to fill the rest with black, internally.
Can we mabe have a look at the original PNG that you use to paint the x_sprite?
X_MAKE3D 1,1500,45
X_CAMERA camx+offset, 20+camY, -400, camx+offset, 0, 0
X_FOG RGB(255,255,255), FALSE,800, 1000
//draw
ALPHAMODE -1
FOR x=0 TO LEN(horde)-1 STEP 1
X_SPRITE horde
- .spr, horde
- .x, horde
- .y, horde
- .z, horde
- .s
NEXT
X_MAKE2D
ALPHAMODE -1
DRAWSPRITE 800,0,20+camY
SHOWSCREEN
WEND
im attaching thre png i use for the xSprite
[attachment deleted by admin]
it's 640 wide. Make the sprite 1024 or 512 pixel wide. Next, the transparent background has a white colour . Make that part yellow as well.
maing it 512 didnt change anything
its like earsing all the sprites once in runs
weird
still no alpha just
transperent
Use a sprite with the size 512*512 or 256*256 for e.g?!
I don´t know if the power of two is important for x_sprites but you could try it... :)
I can't get the example to run so can't test for myself but try changing the alphamode to .99 or -.99
noting works :(
My first guess would have been to set the alpha to -0.99 or 0.99 as well.
The land.png looks just fine. Works with smooth alpha in my applications.
Pls post the the full (executable) code or zip ur project for more help.
in photoshop, used the magic wand select the area,
invert it and copy, paste the area,
you should now have two images / layers, one been the background, delete the back ground layer, the layer left has a checked background, save that file out as a png, glbasic know what is transperant. I hope that helps
if you have a example you could send me, with code.
here is the project part that dosent do alpha at all for some reason
[attachment deleted by admin]
Huh?
Alpha works, doesn´t it?!
I can only see the grass, no black edges or sth. else.
is there sometin gim missing in gl basic?
i got the latest update and i tested it on 2 computers even on the iphone same thing :(
Just remming out all the alphas and just adding a single alpha -0.999 at the start seemed to work, I do like the code. nice affect Matey.
I all so tried remming the alpha's and got some strange affects depending which alpha I tried remming.
Hope this helps.
[attachment deleted by admin]
http://www.glbasic.com/forum/index.php?topic=3858.msg28153#msg28153
? dont understand
Fixed :)
i had to reverse the order of the drawing sprites form top to bottom
yepp thats it!