|
1 registered members (AndrewAMD),
1,065
guests, and 8
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
How can I get number of Panel
#293960
10/15/09 06:51
10/15/09 06:51
|
Joined: Mar 2009
Posts: 2 Russia
Lowfog
OP
Guest
|
OP
Guest
Joined: Mar 2009
Posts: 2
Russia
|
Hello. Please, help: 1. I create panel in cycle 0to20: mypan[n]= pan_create("button=0,0,64,128,bmo,bmon,bmov,fon,frel,fov;"); 2. How can I get number n in function fov?
|
|
|
Re: How can I get number of Panel
[Re: Lowfog]
#293961
10/15/09 07:36
10/15/09 07:36
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Is this what you mean?
.
...
mypan[n] = pan_create("button=0,0,64,128,bmo,bmon,bmov,fon,frel,fov;");
(mypan[n]).skill_x = n;
...
function fov(PANEL* pan)
{
var panel_button_number = pan.skill_x;
...
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: How can I get number of Panel
[Re: Lowfog]
#293962
10/15/09 07:36
10/15/09 07:36
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
first: define fov like function fov(var button_number,PANEL* panel)
second: after creating your panel with mypan[n]= pan_create("button=0,0,64,128,bmo,bmon,bmov,fon,frel,fov;"); put this line. mypan[n].skill_x = n;
then in fov you can get this number back from the skill
like function fov(var button_number,PANEL* panel){ if(panel.skill_x==2)//panel.skill_x is your "n" }
:evilsob was faster
Last edited by Quadraxas; 10/15/09 07:37.
3333333333
|
|
|
Re: How can I get number of Panel
[Re: Quad]
#293963
10/15/09 07:54
10/15/09 07:54
|
Joined: Mar 2009
Posts: 2 Russia
Lowfog
OP
Guest
|
OP
Guest
Joined: Mar 2009
Posts: 2
Russia
|
|
|
|
Re: How can I get number of Panel
[Re: Lowfog]
#293965
10/15/09 08:13
10/15/09 08:13
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
DoH!
Quadraxas got me again. I always forget to include the button_number parameter. (it IS important, but I seldom use it)
Sorry, but the rest of my code should be ok, cause Quadraxas's is the same I feel sure of that.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|