division glitch, wont go into decimals; i need another way

Non-platform specific questions.

division glitch, wont go into decimals; i need another way

Postby DarkParadox » Wed Mar 26, 2008 9:42 pm

i'm trying to make an x position into decimals, like so that if x = 30 transp = .30 without making about 100 lines of code, can someone give me a code for this?
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 9:58 pm

transp = (double)x / 100;

That should do it.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby DarkParadox » Wed Mar 26, 2008 10:06 pm

sadly, no....
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 10:07 pm

One sec, I'll post a demo!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 10:13 pm

Here it is!
Drag the actor with the mouse to see the transparency change.

Transparent transition.zip
Location vs. transparency
(762 Bytes) Downloaded 122 times
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby DarkParadox » Wed Mar 26, 2008 10:17 pm

can you tell me how to do that when theres only 100 x i can go across?
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 10:20 pm

First, you have to tell me what you mean and what that is for.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby DarkParadox » Wed Mar 26, 2008 10:22 pm

i'm making a painter for a PDA game and need it for a transperancy slider
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 10:22 pm

Give me a moment, I'll do that too!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby DarkParadox » Wed Mar 26, 2008 10:24 pm

i just need the code
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 10:34 pm

Hmmm... Seems like I have a problem... I'll look into it more and post a little later, sorry for the wait.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby DarkParadox » Wed Mar 26, 2008 10:35 pm

i ONLY need the code
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby pyrometal » Wed Mar 26, 2008 10:44 pm

I know you wanted only the code but I had to try it for myself... So here's a demo WITH the code inside!

slider.zip
(1.91 KiB) Downloaded 114 times
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby Game A Gogo » Thu Mar 27, 2008 8:30 pm

This happen in some way or another, I have no clue why...
But here is something that might help ya:
CW-Sprite Designer.zip
note, rotation only cause GE to freeze or something like... old thing I made
(399.86 KiB) Downloaded 104 times


also why we post demo and not only the code, is because we have no clue how you settled up your thing
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: division glitch, wont go into decimals; i need another way

Postby JayInACob » Wed Jun 04, 2008 2:34 pm

guys, why dont u just multiply it by 0.001 ?
JayInACob
 
Posts: 6
Joined: Fri Aug 17, 2007 5:00 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron