Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
animated game menu.... #291561
09/26/09 13:42
09/26/09 13:42
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
is it possible to use a animated gif or play an avi on the game main menu? i have a menu code, and it works fine, but i would like animate the actual game logo panel. i dont know where to start.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: animated game menu.... [Re: Blink] #291760
09/27/09 18:51
09/27/09 18:51
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
ok, forget about the avi or animated panel. is it possible to make a panel blink(no pun intended)? i have a logo panel, and i just want a separate panel to blink next to it, adding a number to the title. can someone help me with that?

update: ok, i got it to blink once, but how can i get it to continue to blink say evey 2 seconds?
Code:
bmap numb1_bmp = <6pic1b.bmp>;

bmap numb2_bmp = <6pic1.bmp>;

panel picture_pan

{

       layer = 10;

       pos_x = 100; // use your own values here

       pos_y = 100;

       flags = visible, overlay;

}


starter blink_pictures()

{
        while (1) 
        {

               temp = 1 + int (random(2));

               if (temp == 1)

               {

                       picture_pan.bmap = numb1_bmp;

               }

               if (temp == 2)

               {

                      picture_pan.bmap = numb2_bmp;

               }
       wait(-2); 
        }
}



Last edited by Blink; 09/27/09 20:36.

My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: animated game menu.... [Re: Blink] #291805
09/28/09 06:41
09/28/09 06:41
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Change this line
temp = 1 + int (random(2));

to:
temp = cycle(temp+1,1,3);

this will change the temp variable every two seconds (as you have a wait(-2) between 1 and 2 (3 = upper limit (not including))

Re: animated game menu.... [Re: Xarthor] #291839
09/28/09 12:51
09/28/09 12:51
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
it still doesnt work.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: animated game menu.... [Re: Blink] #291884
09/28/09 18:31
09/28/09 18:31
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Happy Birthday Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
For an animated panel you could use the "window" function (have a look at the manual). For example if you had a 128x128px logo and 8 frames you could create a 1024x128px bitmap and display only the current frame by shifting the visible part via the window function for 128pixels - hard to explain in English.
To your code:

starter blink_pictures() {
var status = 0;
while (1) {
status = (status == 0);

if (status) { picture_pan.bmap = numb1_bmp; }
else { picture_pan.bmap = numb2_bmp; }
wait(-2);
}
}

or

starter blink_pictures() {
while (1) {

picture_pan.bmap = numb1_bmp;
wait(-2);
picture_pan.bmap = numb2_bmp;
wait(-2);
}
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: animated game menu.... [Re: Superku] #291932
09/29/09 01:34
09/29/09 01:34
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
it's the same results as how i wrote the code. the picture blinks once and stays lit. i want it to blink off and on like a "no vacancy" sign. is that possible?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: animated game menu.... [Re: Blink] #291937
09/29/09 04:26
09/29/09 04:26
Joined: May 2006
Posts: 148
Latvia
MTD Offline
Member
MTD  Offline
Member

Joined: May 2006
Posts: 148
Latvia
Hi,

I think the problem is:
-the temp will always be more than > 1(because it's not set to 0) smile

Here is my code:

Quote:

bmap pan1_bmap = "pan1.pcx";
bmap pan2_bmap = "pan2.pcx";

panel free1 {bmap=pan1_bmap;}
panel free2 {bmap=pan2_bmap;}

while(1)
{
blink+=1*time_step;
if(blink < 1){free1.visible = on;free2.visible = off;}
if(blink >= 1){free2.visible = on;free1.visible = off;}
blink%=2;
wait(-0.5);
}



Tested and worked fine. (Maybe rubbish)

Re: animated game menu.... [Re: MTD] #292032
09/29/09 19:20
09/29/09 19:20
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Happy Birthday Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I almost can't believe that, add a beep() to the while loop for testing purposes.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: animated game menu.... [Re: Superku] #292165
09/30/09 18:27
09/30/09 18:27
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
i will have a look when i get home from work. thanks for the suggestions.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: animated game menu.... [Re: Blink] #292176
09/30/09 19:52
09/30/09 19:52
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Happy Birthday Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)

Copy this into a new *.wdl file and run it, works fine...



var video_mode = 8;

string level_str = <test.WMB>;

function main() {
level_load(level_str);
}

bmap numb1_bmp = <pic1.bmp>;
bmap numb2_bmp = <pic2.bmp>;

panel picture_pan {
flags = visible, overlay;
layer = 10;
}



starter blink_pictures() {
var status = 0;
while (1) {
status = (status == 0);

if (status) { picture_pan.bmap = numb1_bmp; }
else { picture_pan.bmap = numb2_bmp; }
wait(-2);
}
}

/* this one works, too

starter blink_pictures2() {
while (1) {
picture_pan.bmap = numb1_bmp;
wait(-2);
picture_pan.bmap = numb2_bmp;
wait(-2);
}
}

*/


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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