Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
transparency #80201
07/01/06 20:34
07/01/06 20:34
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
I have a script which changes the alpha of an panel.
It fades good, but after 1 fade, it stops... Until I recall the function...
I want it to loop so it fades continious...

Can somebody help me?
This is the script:
Code:
function 1st_flash() {

while(pan_1st_flash.alpha < 60) {
pan_1st_flash.alpha = min(60,(pan_1st_flash.alpha + 2 * time));
wait(1);
}
while(pan_1st_flash.alpha > 20) {
pan_1st_flash.alpha = max(20,(pan_1st_flash.alpha - 2 * time));
wait(1);
}
}




The best games are the games you create yourself.
Re: transparency [Re: NL_3DGS_n00b] #80202
07/01/06 21:27
07/01/06 21:27
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Fixed:

Code:
function 1st_flash() {
while(1){
while(pan_1st_flash.alpha < 60) {
pan_1st_flash.alpha = min(60,(pan_1st_flash.alpha + 2 * time));
wait(1);
}
while(pan_1st_flash.alpha > 20) {
pan_1st_flash.alpha = max(20,(pan_1st_flash.alpha - 2 * time));
wait(1);
}
}
}




The best games are the games you create yourself.
Re: transparency [Re: NL_3DGS_n00b] #80203
07/01/06 21:30
07/01/06 21:30
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Code:

var alphaValue;

function 1st_flash()
{
if (pan_1st_flash.alpha > 60)
{
alphaValue = -2;
}

if (pan_1st_flash.alpha < 20)
{
alphaValue = 2;
}

pan_1st_flash.alpha += alphaValue * time;
}

function main()
{
level_load(...);
//.....
while(1)
{
1st_flash();
wait(1);
}
}



As always, not tested, let me know if it won't work.

Edit
----
Ok, just ignore it if you find your solution.


Last edited by vlau; 07/01/06 21:31.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1