1 registered members (TipmyPip),
18,388
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
panel visible
#226940
09/12/08 02:31
09/12/08 02:31
|
Joined: Aug 2008
Posts: 25
bluemax
OP
Newbie
|
OP
Newbie
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
Expert
|
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
flits
User
|
User
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
Expert
|
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: bluemax]
#227044
09/12/08 13:21
09/12/08 13:21
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
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
bluemax
OP
Newbie
|
OP
Newbie
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
Expert
|
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 ...
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: bluemax]
#227195
09/13/08 03:31
09/13/08 03:31
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Not a problem. [bow]  [/bow] Glad to be of help.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|