Menu Question
Moderators: marionline, SDHawk
- Taco Bot
- Meat, Cheese, and Silicon
- Posts: 484
- Joined: Fri Jul 18, 2014 12:15 am
- Location: Santa Cruz
- Contact:
Menu Question
Hee hee, here I am again with another question!
Is there any way to make a line in a menu that can't be highlighted? As in, the cursor just skips over it when it's doing its thang. If so, how?
Is there any way to make a line in a menu that can't be highlighted? As in, the cursor just skips over it when it's doing its thang. If so, how?
Sent from my iPhone
I'm afraid not. That is definitely the #1 most obvious feature that ought to be added to customisable menus. It has been for a long time, so I don't want to make any promises...
Last edited by TMC on Fri May 27, 2016 7:01 am, edited 1 time in total.
If you want interesting UI, I suggest creating a slice collection for your menu anyway. It's one of the simple things you can do to make a game look just a little bit nicer overall. There's so much more you can do with a menu than just have it pop up instantly center screen.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
You open a menu as usual, but you set "no box" on and load a slice collection with it. So you'd have a script that loads a slice collection to a variable, maybe global, then open menu(#). Make a close script and set it to the menu's on-close script, which should free the slice collection.
That's the basics of it. I'm sure you'll have more specific questions as well. Let me know if any of that didn't make sense.
That's the basics of it. I'm sure you'll have more specific questions as well. Let me know if any of that didn't make sense.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
Actually, kylekrack was suggesting just displaying a slice collection behind a regular menu.
This is completely optional, but once you have a slice collection like that you can run a script which modifies it depending on what menu item is selected. That's easy to do using select slices; you can use the following script for any such menu. How it works is that it checks which menu item is selected, and sets the corresponding child of the slice with lookup code "menu select slice", which needs to be a Select slice.
Using this, you could even give all the menu items blank names and display everything using the slice collection. For example the collection could just be a set of backdrops, one per menu item.
I haven't tested this script.
Edit: Ha, I went to add a link to this script to the wiki, and found that I had written one before, here. This one is simpler and more modern.
This is completely optional, but once you have a slice collection like that you can run a script which modifies it depending on what menu item is selected. That's easy to do using select slices; you can use the following script for any such menu. How it works is that it checks which menu item is selected, and sets the corresponding child of the slice with lookup code "menu select slice", which needs to be a Select slice.
Using this, you could even give all the menu items blank names and display everything using the slice collection. For example the collection could just be a set of backdrops, one per menu item.
Code: Select all
plotscript, slice augmented menu, begin
# Assume the menu is already open
variable (menu, collection, selection)
collection := load slice collection(1) # Change the collection ID
menu := top menu
while (menu is open(menu)) do (
# selection is equal to 0 for the first menu item, 1 for second, etc
selection := menu item true slot(selected menu item(menu))
# Toggle which child of "menu select slice" is visible: first child for first menu item, etc.
set select slice index(lookup slice(sli: menu select slice), selection)
wait
)
free slice(collection)
end
Edit: Ha, I went to add a link to this script to the wiki, and found that I had written one before, here. This one is simpler and more modern.
Last edited by TMC on Sun Dec 18, 2016 11:34 pm, edited 3 times in total.
I would offer a tech demo I've made that plays with graphically based menus, but last time I ran I got massive errors, possibly due to the update, but more likely because I changed something and then forgot about it.
That being said, I've dealt with this stuff before, and I know it can raise a lot of questions and confusion as you start scripting it. Looks like TMC has a really solid example there, though.
That being said, I've dealt with this stuff before, and I know it can raise a lot of questions and confusion as you start scripting it. Looks like TMC has a really solid example there, though.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Probably warnings about things which may be incorrect but don't stop the script from workingkylekrack wrote:I would offer a tech demo I've made that plays with graphically based menus, but last time I ran I got massive errors, possibly due to the update, but more likely because I changed something and then forgot about it.
When you play from the "Test Game" in custom, you are in "debug" mode, and it will show you all the errors
When you play in "release" mode, all but the very worst errors are hidden.