Frames/Menu
Author |
Message |
Fashoomp
![](http://compsci.ca/v3/uploads/user_avatars/18515966745ef4dc614ec6.jpg)
|
Posted: Tue Mar 27, 2007 8:10 pm Post subject: Frames/Menu |
|
|
Ok, this i cant figure out. How can i make a menu. I am also familiar with flash, and understand that uses frames. However, turing does not, and i cannot think of any way for the code to go backwards. If i want it to go back and forth between menu screens, how can i do this, without having infinite code. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: Tue Mar 27, 2007 8:31 pm Post subject: RE:Frames/Menu |
|
|
Basically, I'm assuming that you are going to have each different "menu" running in a different procedure. If not, start there. From there, you can use a concept called mutual recursion. This means that one procedure calls another, and that procedure calls the procedure calls the one that called it. This is difficult to do in Turing, because a procedure declared below the currently running one (by line number) doesn't exist within the currently running procedure's scope. In order to fix this, we have to forward the procedure that we want to mutually recurse with another one. This will allow the procedure below the one that we want to recurse with to be within the higher up procedure's scope. Here is some sample code to help:
Turing: |
forward procedure foo (para1 : int, para2 : string)
procedure bar (val1 : int)
if whatever then
foo (val1, 5)
end if
end bar
body proc foo (para1 : int, para2 : string)
if something then
bar (para1 )
elsif other_stuff then
bar (strint (para2 ))
end if
end foo
|
Just be sure to precede the procedure that you are forwarding with the keyword body. This just ensures that the compiler knows that this is indeed the procedure that we are trying to forward for the use of the other procedure.
If you have any other questions, be sure to check out the Turing Walkthrough for some help
EDIT: This code is untested, as I'm on Linux, so if it doesn't work the first time, fiddle around with it and see if it will work ![Wink Wink](images/smiles/icon_wink.gif) |
|
|
|
|
![](images/spacer.gif) |
Drakain Zeil
|
Posted: Thu Mar 29, 2007 6:01 pm Post subject: RE:Frames/Menu |
|
|
you could grab screens of each menu screen, and then load them using procedures depending on where the user wants to go.
render on first load, draw pic on all future loads. |
|
|
|
|
![](images/spacer.gif) |
|
|