Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
panel visible #226940
09/12/08 02:31
09/12/08 02:31
Joined: Aug 2008
Posts: 25
B
bluemax Offline OP
Newbie
bluemax  Offline OP
Newbie
B

Joined: Aug 2008
Posts: 25
I can't get my panel(s) to work correctly. I declare them, set the flags and during the the main function, make them visible. However, the code snippetes i have read to make them disappear does not work...

#include <acknex.h>
#include <default.c>

...

PANEL* k1totals =
{
layer = 1;
pos_x = 20;
pos_y = 100;
digits(0,0,"The player has %.0f points",*,1,k1_total);
flags = VISIBLE;
}
...
void main()
{
...
if(x == 1)
{
k1toatls.flags = 0; //doesn't work
k1totals.visible = off; //doesn't work
reset(k1totals,VISIBLE); // nope
toggle(ktotals,VISIBLE); //nada
}
}

please help...

Re: panel visible [Re: bluemax] #226942
09/12/08 02:50
09/12/08 02:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Icant see enything wrong here except (as youve said)
k1toatls.flags = 0; //doesn't work
k1totals.visible = off; //doesn't work

are wrong and wont work.

BUT both
reset(k1totals,VISIBLE);
toggle(ktotals,VISIBLE);

should work fine.

Make sure you DONT use either of the faulty lines ever,
as they may screw up the flag structure and nothing will
work right after that.

In your code, put a beep(); after the 'reset' or 'toggle'
commands to make sure it is being reached.
That is, to make sure x==1 is ever sucessfully true.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: panel visible [Re: EvilSOB] #226997
09/12/08 10:43
09/12/08 10:43
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
another question have you tryed it white level_load ore wite vec_set(screen_color,vector(255,0,0)); // blue

maby the screen isnt refreshing


"empty"
Re: panel visible [Re: flits] #227008
09/12/08 11:13
09/12/08 11:13
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Thanks flis, i may have spotted another issue thanks to your input.

Bluemax, I assume there is a "while(1) wait(1);" loop in your main?

If you dont know what I mean, that may be where the problem is.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: panel visible [Re: flits] #227019
09/12/08 11:53
09/12/08 11:53
Joined: Aug 2008
Posts: 25
B
bluemax Offline OP
Newbie
bluemax  Offline OP
Newbie
B

Joined: Aug 2008
Posts: 25
I believe the panel is being refreshed because I change the BMAP several times successfully. Does changing the BMAP have any baring on VISIBLE?

Also, another clue may be that digits are placed on TOP of previous digits. This makes the digit hard to read. I would expect the new digit to REPLACE the old.

I'm anxious to heae your input

Re: panel visible [Re: bluemax] #227044
09/12/08 13:21
09/12/08 13:21
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ooooerrrr. Very weird.

Now I take it the code you've posted is a example rather than your ACTUAL code.
Thats cool, but if Im guessing correct its causing us an issue in diagnosis.

The digits being 'overlayed' as you describe, sounds like there is multiple layers of panel.
This can happen if you're using pan_create to spawn a panel at run time, and spawn
new copies ON TOP OF the old one. BUT the example you give is a globally defined one,
and that cant happen with them. There IS only one.

If Im wrong with my above statement, that leaves me with two REMOTE possibilities.
1> DirectX issues on your computer. (Test by playing games)
2> Youve somehow managed to get the Global Panel definition INSIDE a function. Its rare,
but it can be done. Ive done it with sloppy cut and paste a couple of times.

Any help?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: panel visible [Re: EvilSOB] #227106
09/12/08 17:08
09/12/08 17:08
Joined: Aug 2008
Posts: 25
B
bluemax Offline OP
Newbie
bluemax  Offline OP
Newbie
B

Joined: Aug 2008
Posts: 25
I wrote a quick code which I saved as panel.c and ran it:

#include <acknex.h>
#include <default.c>

var p1_totals=10;


PANEL* pls =
{
layer = 1;
pos_x = 20;
pos_y = 100;
digits(0,0,"The player has %.0f lives",*,1,p1_totals);
flags = VISIBLE;
}
void main()
{
wait(-2);
if (p1_totals == 10)
{
wait(-1);
beep();
p1_totals=5;
}
//toggle(pls, VISIBLE);
}

The display is as follow: The player has 10 lives
After the beep this is displayed OVER the above:
the player has 5 lives

...making the number and the word "lives" unreadable.
Also, if I remove the comment lines to execute 'toggle', NOTHING happens after the beep!. Not even "...5 lives" overlayed.

I did VISTA diagnostics check on DirectX 10 and found NO errors. Games, videos, etc. run ok on the system.

any thoughts?

Re: panel visible [Re: bluemax] #227172
09/12/08 22:13
09/12/08 22:13
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Got it!

The problem is (maybe even a bug) that the panel doesnt reDRAW
properly if there is no BMAP entry in the panel. It looks like
it doesnt erase old data if theres no to put over it.

I tested yours by adding this line into the Panel definition
Code:
...
bmap = "test.bmp";
...
and creating a 300x200 black bitmap file called test.bmp using paintbrush.

Works fine for me. How about for you?

PS make the bmap black and turn OVERLAY flag on in the panel to make
the black transparent.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: panel visible [Re: EvilSOB] #227192
09/13/08 02:59
09/13/08 02:59
Joined: Aug 2008
Posts: 25
B
bluemax Offline OP
Newbie
bluemax  Offline OP
Newbie
B

Joined: Aug 2008
Posts: 25
Take a bow!

nicely done.

Thank you

Re: panel visible [Re: bluemax] #227195
09/13/08 03:31
09/13/08 03:31
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Not a problem. [bow] grin [/bow] Glad to be of help.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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

Gamestudio download | 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