 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
alphawolf
Joined: 17 Aug 2012 Posts: 33 Location: South Carolina, America
|
Posted: Sat May 18, 2013 4:00 pm Post subject: More on Menu Slices |
|
|
Can entire Menus (Edited in custom.exe) be placed onto the screen with slices? If so, will they function properly? _________________ #AlphaWolf#
http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.
##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios## |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun May 19, 2013 2:05 am Post subject: |
|
|
Yes, but menus aren't currently aren't slice-based. To open a menu created in Custom, use the 'open menu' command. You can even create menus entirely by script, creating an empty menu with 'create menu' and then adding menu items to it one at a time. There are lots of commands to manipulate every aspect of a menu. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
alphawolf
Joined: 17 Aug 2012 Posts: 33 Location: South Carolina, America
|
Posted: Sun May 19, 2013 4:18 am Post subject: |
|
|
Thanks, I guess now I should delve into the plotscripting dictionary  _________________ #AlphaWolf#
http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.
##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios## |
|
Back to top |
|
 |
alphawolf
Joined: 17 Aug 2012 Posts: 33 Location: South Carolina, America
|
Posted: Sun May 19, 2013 5:07 am Post subject: |
|
|
Now, if I want both a slice and a menu up at the same time, which wait command should I try? I've tried "waitforkey", "waitformenu", "waitforslice", and "waitforall", but no matter what wait command I use, the menu and the slice I want up both display at separate times and close at separate times.
Here's my code:
if (keyispressed (key:esc), or, keyispressed (key:alt)) then(
variable(pOne), pOne := createrect(200, 100, 0)
putslice(pOne, 0, 0)
wait(1)
openmenu(0)
#I've tested with each of these wait commands.
#waitforkey(menuKey)
#waitforall
#waitforslice(pOne)
#waitformenu(0)
free slice(pOne)
) _________________ #AlphaWolf#
http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.
##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios## |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun May 19, 2013 9:16 am Post subject: |
|
|
It does not look like you want any kind of wait at all. Just leave it out.
You should split this task into several scripts.
The first script just puts the slices on the screen, and opens the menu, and then leaves them there.
After that script is run, the user will have control of the menu. You can write another script for when the menu is closed which also removes the slices.
Code: |
global variable(0, menu slices)
plotscript, on key press handler, begin
if (keyispressed (key:esc), or, keyispressed (key:alt)) then(
open menu with slices
)
end
script, open menu with slices, begin
menu slices := createrect(200, 100, 0)
putslice(menu slices, 0, 0)
openmenu(0)
end
script, on menu close, begin
free slice(menu slices)
end
|
|
|
Back to top |
|
 |
alphawolf
Joined: 17 Aug 2012 Posts: 33 Location: South Carolina, America
|
Posted: Mon May 20, 2013 12:54 pm Post subject: |
|
|
Thanks! Now one more question (mostly on your example, James), your example binded the variable menuslices before declaring it; You don't have to declare a variable first in hspeak? _________________ #AlphaWolf#
http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.
##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios## |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon May 20, 2013 5:45 pm Post subject: |
|
|
"menu slices" has been declared. It was declared as a global variable. That makes it accessible from all scripts.
Also, in HamsterSpeak order of declarations doesn't matter. "global variable" can be placed after a script that uses that variable, and likewise "variable" can appear after that variable's use. Ditto for scripts which call each other, and for constants. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
alphawolf
Joined: 17 Aug 2012 Posts: 33 Location: South Carolina, America
|
Posted: Mon May 20, 2013 5:51 pm Post subject: |
|
|
Oh jeez I'm blind I didn't see the Global declare, sorry about that. _________________ #AlphaWolf#
http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.
##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios## |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|