|
0 registered members (),
631
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Problem with panel - change pos_y
#281984
07/29/09 19:12
07/29/09 19:12
|
Joined: Jul 2009
Posts: 5
Kubiro
OP
Newbie
|
OP
Newbie
Joined: Jul 2009
Posts: 5
|
Hi, I want after click on button do function that change pos_y of "PANEL* player_inventory" but I dont know how =( I tried this:
function change()
{
player_inventory.pos_y = 10;
}
But dont help. Thanks very much. (P.S.: Sorry for my english, I am czech)
|
|
|
Re: Problem with panel - change pos_y
[Re: Kubiro]
#281985
07/29/09 19:20
07/29/09 19:20
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Hi, Seems like you did it the right way though, are you sure that the function is called at all? Try this to test whether the function was called:
function change()
{
player_inventory.pos_y = 10;
error("panel should have been moved now!");
}
That will make a messagebox appear when the function is called 
Last edited by Claus_N; 07/29/09 19:21. Reason: typo
|
|
|
Re: Problem with panel - change pos_y
[Re: Kubiro]
#281988
07/29/09 19:29
07/29/09 19:29
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
try changing this:
flags = SHOW | OVERLAY;
to this:
flags |= SHOW | OVERLAY;
I don't know whether that would make a difference, but forgetting to set the flags the right way on particles make them behave strange. Apart from that it seems fine, though I would put the "change()"-function below the panel definition, but that will probably not make any difference.
Last edited by Claus_N; 07/29/09 19:34.
|
|
|
Re: Problem with panel - change pos_y
[Re: Claus_N]
#281990
07/29/09 19:34
07/29/09 19:34
|
Joined: Jul 2009
Posts: 5
Kubiro
OP
Newbie
|
OP
Newbie
Joined: Jul 2009
Posts: 5
|
player_inventory.pos_y = 10; There is problem.. because when I deleted this line, the error window showed without errors. player_inventory is wrong way to panel but why ?
Last edited by Kubiro; 07/29/09 19:34.
|
|
|
Re: Problem with panel - change pos_y
[Re: Claus_N]
#281993
07/29/09 19:48
07/29/09 19:48
|
Joined: Jul 2009
Posts: 5
Kubiro
OP
Newbie
|
OP
Newbie
Joined: Jul 2009
Posts: 5
|
I changed flags "|" and nothing. And it still write this error: ERROR in 'MAIN' line 92: 'player_inventory' undeclared identifier < player_inventory.pos_y = 10; > and on line 92 is
player_inventory.pos_y = 500;
and i cant find change pos_y in manual
Last edited by Kubiro; 07/29/09 19:49.
|
|
|
Re: Problem with panel - change pos_y
[Re: Kubiro]
#281994
07/29/09 19:52
07/29/09 19:52
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
ahh, well then you just need to place the "change" function below the panel definition 
function change();
PANEL* player_inventory =
{
pos_x = 824;
pos_y = 418;
layer = 1;
bmap = player_inventory_bmap;
button (184, 5, "panel_hide_click.tga", "panel_hide_normal.tga", "panel_hide_over.tga", change(), NULL, NULL);
flags = SHOW | OVERLAY;
}
function change()
{
player_inventory.pos_y = 10;
error("panel should have been moved now!");
}
|
|
|
|