2 registered members (TipmyPip, 1 invisible),
18,787
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Can I use panels as buttons? [Solved]
#240370
12/10/08 17:06
12/10/08 17:06
|
Joined: Jul 2008
Posts: 23 Turkey
Hatean
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 23
Turkey
|
I have got some pannels and I want to use them as buttons.
Like there is continue and continueRollover panels. I want to make continue panel a button and when it is pushed it should change to continueRollover. Then of course it should trigger a function.
I know button(...). But I couldn't use panels in it, it uses bmaps...
Thanks for helping...
Last edited by Hatean; 12/12/08 17:06.
The Life Game is disgustingly bad but the graphics and reality are extremely cool...
|
|
|
Re: Can I use panels as buttons?
[Re: Hatean]
#240372
12/10/08 17:23
12/10/08 17:23
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
take a look at: on_click example (C-Script):
panel my_pan
{
...
on_click = my_function;
}
edit: In lite-C it is: event example (lite-C):
PANEL* my_pan
{
event = my_function;
}
Last edited by Xarthor; 12/10/08 17:25.
|
|
|
Re: Can I use panels as buttons?
[Re: Xarthor]
#240403
12/10/08 19:50
12/10/08 19:50
|
Joined: Jul 2008
Posts: 23 Turkey
Hatean
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 23
Turkey
|
Thanks... I am using lite-c by the way.
But I couldn't find any events for PANEL in Manual. And how can I do rollover thing with that? Are EVENT_CLICK, EVENT_RELEASE can be used in PANEL and how will I do that? Can I write "emask = EVENT_CLICK;" in a PANEL?
The Life Game is disgustingly bad but the graphics and reality are extremely cool...
|
|
|
Re: Can I use panels as buttons?
[Re: Hatean]
#240413
12/10/08 20:44
12/10/08 20:44
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Create a panel with just a button at 0,0 in it, no bmap and no event. The panel will then be created at the same size as the buttons bmap, and use the button events from there on in.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Can I use panels as buttons?
[Re: EvilSOB]
#240759
12/12/08 11:30
12/12/08 11:30
|
Joined: Jul 2008
Posts: 23 Turkey
Hatean
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 23
Turkey
|
It doesn't accept any button without bmap. Also even if it works how am I goning to make it as I said? I want to I tried so many things but I can't do it. I just want a button which uses a panel for BMAP and another panel for mouse over, of course with a clicking function  Can anybody write an example code please...
The Life Game is disgustingly bad but the graphics and reality are extremely cool...
|
|
|
Re: Can I use panels as buttons?
[Re: Hatean]
#240774
12/12/08 13:17
12/12/08 13:17
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
ya aslinda cok basit.
function butona_tiklayinca_calisan_fonk(){ sys_exit(" ");//mesela }
PANEL* asdasd = { button(x, y, normal_haldeki_bmap, bmapOff, ustune_gleinceki_bmap, butona_tiklayinca_calisan_fonk, functionOff, ustune_gelince_calisanfonk); flags = VISIBLE; }
3333333333
|
|
|
Re: Can I use panels as buttons?
[Re: Quad]
#240783
12/12/08 15:07
12/12/08 15:07
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Quadraxas has the example of what I meant, but I only speak english, so I dont know what else he's saying... But.
As his example shows, create a panel with no bmap, you can give it a position though, then put ONE button in it(with all appropriate bmaps). The whole panel is now JUST that button, with all standard button functionality.
The panel you are creating is just to position and to control display flags for the button, because buttons arent allowed outside a panel.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Can I use panels as buttons?
[Re: EvilSOB]
#240790
12/12/08 16:36
12/12/08 16:36
|
Joined: Jul 2008
Posts: 23 Turkey
Hatean
OP
Newbie
|
OP
Newbie
Joined: Jul 2008
Posts: 23
Turkey
|
OK then. First, thanks Quadraxas for your help. I'll try it. Actually the problem is my buttons should be flaged as OVERLAY. And I'm not sure if I can use something like that : "my_bitmap.flags = OVERLAY;". Hope I can. Thanks for example code again..
@EvilSOB: Hey, now I understand why engine said "undefined" when I used it outside a panel. Thanks for your help, too.
I m going to try it now, hope it works as I wanted...
EDIT: It works! Thank you all for helps...
Last edited by Hatean; 12/12/08 17:05.
The Life Game is disgustingly bad but the graphics and reality are extremely cool...
|
|
|
|