Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / problemo with my function

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 18th Oct 2003 02:02
i made a funtion to make buttons for me. it is awsome. but i have one problem.



the target. i need a way to define where i want it to go when i press the button. i dont think gosub will work to great, if i get it to work. any ideas?

<{^_^<}
PolyVector
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Ghetto Land
Posted: 18th Oct 2003 05:48
I could be wrong...but I don't think DB supports function pointers or getting line label pointers....so you'll have to do something cheesy like:
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 19th Oct 2003 08:32 Edited at: 19th Oct 2003 08:34
oh, wait. i dont understand what your doing there. could you explain everything in that SELECT command?

so is there an easier way to make buttons that i dont have to keep writing the code over and over then? because what i was going to do, was make it so i could draw the buttons in DB inside of the function, and not have to use images. but i didnt want to do that until i was sure how to do that. any ideas? I really need this. it would be WAY helpfull!

<{^_^<}
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 19th Oct 2003 22:59
try this hope it help

You cant do it if you try
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Oct 2003 00:10
ok, that should work. thanx. but the nimage=target(1) or whatever. do i use nimage or a differnt varable. nimage is the starting image. the buttons normal image.

<{^_^<}
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 20th Oct 2003 04:37
nimage is the button that is click

example

if target(1)=1 then gosub button_click 1
if target(1)=2 then gosub button_click 2
and so on

You cant do it if you try
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Oct 2003 22:25
ah, i see, thanx. i think that will work.
now im trying to make it so i could draw the buttons in DB inside of the function, and not have to use images. penguins are still cute

<{^_^<}
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 21st Oct 2003 17:30
If you do it that way and you use lots of buttons it will slow your program down i have a function if you want it or i can help you with yours

You cant do it if you try
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 22nd Oct 2003 06:47
can i see your function?

<{^_^<}

Login to post a reply

Server time is: 2025-05-21 09:51:24
Your offset time is: 2025-05-21 09:51:24