How to return the number of an element?

Posted By: exile

How to return the number of an element? - 07/11/12 23:54

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
Posted By: Espér

Re: How to return the number of an element? - 07/12/12 03:44

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
Posted By: Rackscha

Re: How to return the number of an element? - 07/12/12 11:18

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);
}


Posted By: Espér

Re: How to return the number of an element? - 07/12/12 12:16

i wished it would be as easy as in ruby xD

def name(para1(,para2(,para3)))
and so on
Posted By: exile

Re: How to return the number of an element? - 07/13/12 16:51

So if I want to return the numberID of the button my mouse is currently over, I can use overloading to do that?
© 2024 lite-C Forums