Button which opens up a menu screen
Posted: Mon May 18, 2020 11:12 am
Hi all,
I'm trying to create a button which opens up a choice menu screen (It's to comment on a picture in a social media-like interface).
I've been reading this post: viewtopic.php?t=44767 , though I am unsure how to proceed.
The screen which has the button is below:
My script shows up as follows:
How do I get this to work?
I'm trying to create a button which opens up a choice menu screen (It's to comment on a picture in a social media-like interface).
I've been reading this post: viewtopic.php?t=44767 , though I am unsure how to proceed.
The screen which has the button is below:
Code: Select all
screen pic_violet(log):
zorder 0
modal True
tag sharkmenu
use shark_interface
add "images/menu_on.png" xpos 0 ypos 344
imagebutton idle "images/back_button.png" clicked [Hide("pic_violet"), Show("feudal_fantasy_community")] xpos 16 ypos 960 focus_mask True
imagebutton idle "images/post_button.png" action [Show("write_post"), choice_items1] xpos 1700 ypos 16 focus_mask True
text _("Feudal Fantasy Community") color "#000000" xpos 30 ypos 16
vbox:
xpos 334
ypos 144
spacing 20
add "violet"
frame:
background None
use chat_log2(log)
screen write_post: ## the custom choice screen I want to use here
add "images/write_post.png" xpos 454 ypos 190
text _("Write Post") color "#000000" xpos 890 ypos 202
vbox:
xpos 660
ypos 350
label "Select:"
vbox:
#for i in items:
textbutton i.caption action i.action style "black_text" ## I'm unsure what to put here.
hbox:
xpos 662
ypos 732
spacing 40
button:
action Hide("write_post")
xysize (290, 98)
background "confirm_button"
text _("Cancel") style "black_text" xpos 78 ypos 20
Code: Select all
label pic_violet:
show screen pic_violet(vhslog)
$ vhslog.add_chat(msg="Wow :O", nick="Wolfie", avatar="images/avatars/wolfie.png", posttime="1 day ago") ## previous comments you can read
$ vhslog.add_chat(msg="OMG you can draw so much better than me XD", nick="Markus", avatar="images/avatars/markus.png", posttime="1 day ago")
$ vhslog.add_chat(msg="Haha ;-)", nick="Lindsay222", avatar="images/avatars/lindsay.png", posttime="1 day ago")
$ choice_items1 = ["Wow!", "I love it!", "Meh"] # I want these choice to show when/if the player clicks the post button
pause