Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Animated sprite transp problem

Author
Message
ZtEaLmAx
21
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sweden
Posted: 11th Oct 2006 01:39
Hi ran across this made by D Ogre
but cant get sprite transparancy working, im stuck lol
help me anyone to point out whats missing or what wrong




//Cheers



Yes www.darkbasic.se - swedish forum is comming
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 11th Oct 2006 10:47
The image he is using for the sprites uses magenta ( RGB(255,0,255) ) as the transparent colour. Your sprite sheet will also need to have magenta as the transparent colour.
If you use a diferent colour for transparency, then change this line to represent the colour you are using:


... or better still, get rid of that line completely and use a PNG with a transparent background.


Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 11th Oct 2006 10:47
Firstly, you are confusing sprites with planes - you have no sprites in this code at all, just a 3d plane on a matrix. Sprites are 2d objects created using the sprite command.

To make you plane transparent, add the command 'set object transparency' after each time you retexture it (ie. after the line 'texture object 1,frame')

ZtEaLmAx
21
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sweden
Posted: 11th Oct 2006 13:57
thanx will try it..

and try to remake code so its strictly sprites



Yes www.darkbasic.se - swedish forum is comming
ZtEaLmAx
21
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sweden
Posted: 12th Oct 2006 04:41 Edited at: 12th Oct 2006 04:49
Worked like a sharm thanx

Now an other problem...

if i would like it to be able to press both leftkey and upkey so it move to upleft how do i compine keys? nevermind the anim sequence got that covered, just the correct way to combine keys so it moves correctly



Yes www.darkbasic.se - swedish forum is comming
Ric
21
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Oct 2006 10:18
if upkey()=1 and leftkey()=1 then .......

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 18th Oct 2006 19:14
scancodes are usually a better solution
if scancode(X)=1 then blah
this way it prevents certain sticky combinations that just cant be solved with the other command.

Login to post a reply

Server time is: 2026-07-07 01:30:36
Your offset time is: 2026-07-07 01:30:36