Why doesn't that work?

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Why doesn't that work?

Post by metal_head » Sun Sep 27, 2009 6:24 pm

I'm making a scripted menu for one of my miniprojects, and everything's going well, but I gotta problem, I wanted to make the menu apear smoothly in the beginning by increasing it's alpha. I made a new variable, called "TRANSPARENCY" and made it increase slowly till it reaches 255 and in all DrawFlipbookImages() commands I put TRANSPARENCY in the transparency parameter. Well the level starts, but the menu buttons (the flipbooks) have alpha 255... than once the TRANSPARENCY reaches 255, the cursor appears -

Code: Select all

if (TRANSPARENCY = 255)
{
Cursor();
}
But why the flipbooks don't change their alpha?
I maybe missing something, but I think everything's fine.

Code: Select all

MenuRoutine[ ()
{
if (TRANSPARENCY != 255)
{
TRANSPARENCY = TRANSPARENCY + 1;
}
NEWGAMEPOSX = screenx/2-190;
NEWGAMEPOSY = screeny/2+220;
NEWGAMEPOSXMAX = NEWGAMEPOSX + 380;
NEWGAMEPOSYMAX = NEWGAMEPOSY + 80;
if ((GetMousePosX() >= NEWGAMEPOSX) and (GetMousePosX() <= NEWGAMEPOSXMAX) and (GetMousePosY() 

>= NEWGAMEPOSY) and (GetMousePosY() <= NEWGAMEPOSYMAX) )
{
DrawFlipBookImage("newgame",1,NEWGAMEPOSX,NEWGAMEPOSY,TRANSPARENCY,0,0,0,1);
}
else
{
DrawFlipBookImage("newgame",0,NEWGAMEPOSX,NEWGAMEPOSY,TRANSPARENCY,0,0,0,1);
}

CREDITSPOSX = screenx/2-600;
CREDITSPOSY = screeny/2-50;
CREDITSPOSXMAX = CREDITSPOSX + 380;
CREDITSPOSYMAX = CREDITSPOSY + 80;

if ((GetMousePosX() >= CREDITSPOSX) and (GetMousePosX() <= CREDITSPOSXMAX) and (GetMousePosY() 

>= CREDITSPOSY) and (GetMousePosY() <= CREDITSPOSYMAX) )
{
DrawFlipBookImage("credits",1,CREDITSPOSX,CREDITSPOSY,TRANSPARENCY,0,0,0,1);
}
else
{
DrawFlipBookImage("credits",0,CREDITSPOSX,CREDITSPOSY,TRANSPARENCY,0,0,0,1);
}

HELPSPOSX = screenx/2+350;
HELPSPOSY = screeny/2-40;
HELPSPOSXMAX = HELPSPOSX + 380;
HELPSPOSYMAX = HELPSPOSY + 80;

if ((GetMousePosX() >= HELPSPOSX) and (GetMousePosX() <= HELPSPOSXMAX) and (GetMousePosY() >= 

HELPSPOSY) and (GetMousePosY() <= HELPSPOSYMAX) )
{
DrawFlipBookImage("help",1,HELPSPOSX,HELPSPOSY,TRANSPARENCY,0,0,0,1);
}
else
{
DrawFlipBookImage("help",0,HELPSPOSX,HELPSPOSY,TRANSPARENCY,0,0,0,1);
}
if (TRANSPARENCY = 255)
{
Cursor();
}

} ]

Post Reply