Hi,
I have a looping function to display the buttons on my level selector.. I need to do it in loop since I have 25 ( 5x5 arrangement) levels and it would add so much lines on my code if I'll do it one by one..
But my problem is assigning a function on each buttons since they will execute variable functions..
Eg. when button1 is clicked it will execute on_level1(), button2-on_level2().. and so on
I've tried to use snippets like this, inside my for loop
assume that str_func is initialize as
str_func = str_create("on_level");
level_ID = row + (column * 5);
str_for_int(func_buffer, level_ID);
str_cat(str_func, func_buffer);
and then use str_func inside the button function
pan_create("button(0,0,bmap_levelimage_press1,bmap_levelimage_def1,bmap_levelimage_press1, str_func, NULL, NULL);", 10);
but really funny since I didn't notice that button function should be function name and can't understand what's inside the string..
Is there any dynamic way of implementing that process?
Please advise..
Thanks...