Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to return the number of an element? #404628
07/11/12 23:54
07/11/12 23:54
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
I am posting this here since I figure this is a simple enough request. Basically what I am trying to do is get the number of a panel element to be used as a pointer. I KNOW this is possible since the engine has no problem retrieving information using PANEL->element type->element number, I just dont know how to do it. what I am trying to achieve is when the clicks a panel element it would set a variable to its current ID number. I have a list of servers that get retrieved (which are created at runtime) and their information is stored in an internal array. I am attempting to access the information in that array via button number (ex. return = array[button number]wink

Last edited by exile; 07/12/12 00:11.
Re: How to return the number of an element? [Re: exile] #404630
07/12/12 03:44
07/12/12 03:44
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
void button_function(var butt_num, PANEL* pan)

that's all, Acknex Engine sets this parameters by itself laugh

Btw.: This parameters are optional - you f.e. could use just butt_num or just pan.
I hope that in future we will be able to create such optional parameters by our own.. smirk

Last edited by Espér; 07/12/12 03:47.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: How to return the number of an element? [Re: Espér] #404642
07/12/12 11:18
07/12/12 11:18
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
you create them by overloading.

Code:
void DoFoo(int FooA, int FooB, int FooC)
{
//do something badass
}

void DoFoo(int FooA, int FooB)
{
  DoFoo(FooA, FooB, MyDefault);
}

void DoFoo(int FooA)
{
  DoFoo(FooA, MyDefault);
}




MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: How to return the number of an element? [Re: Rackscha] #404647
07/12/12 12:16
07/12/12 12:16
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
i wished it would be as easy as in ruby xD

def name(para1(,para2(,para3)))
and so on


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: How to return the number of an element? [Re: Espér] #404724
07/13/12 16:51
07/13/12 16:51
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
So if I want to return the numberID of the button my mouse is currently over, I can use overloading to do that?


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