I want to make just my first menu choice be different. This is possible?
My first menu is a normal menu like:
Code: Select all
menu:
"yes!":
jump accepted
"No!":
jump denied
Code: Select all
menu:
"yes!":
jump accepted
"No!":
jump denied
Code: Select all
screen Special_select:
textbutton("Yes!):
area(25, 25, 200, 40)
background "Button.png"
hover_background "ButtonActivated.png"
hover_sound "synthwoosh.wav"
activate_sound "click.wav"
action Jump("accepted")
textbutton("No!"):
area(25, 70, 200, 40)
background "Button.png"
hover_background "ButtonActivated.png"
hover_sound "synthwoosh.wav"
activate_sound "click.wav"
action Jump("denied")
Code: Select all
label start:
"......"
call screen Special_select #call our special menu
"....."
return
label accepted:
"...1."
menu:
"This is standard menu"
"Go to West":
pass
"Go to North":
pass
return
label denied:
"..2."
menu:
"This is standard menu"
"Go to East":
pass
"Go to South":
pass
return
Code: Select all
style.menu_choice_custom_button.set_parent(style.menu_choice_button)
style.menu_choice_custom_button.background=Frame("mycustombutton.png",25,25)
style.menu_choice_custom_button.font = "myfont.ttf"
style.menu_choice_custom_text.font = "myfont.ttf"
style.menu_choice_custom_text.size = 30
style.menu_choice_custom_text.hover_color = "ffffff"
Code: Select all
screen choice:
window:
style "menu_window"
xalign 0.5
yalign 0.5
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
if action:
if "(custom)" in caption:
$ caption = caption.replace(" (custom)", "")
button:
action action
style "menu_choice_custom_button"
text caption style "menu_choice_custom_text"
else:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
init -2:
$ config.narrator_menu = True
style menu_window is default
style menu_choice is button_text:
clear
style menu_choice_button is button:
xminimum int(config.screen_width * 0.75)
xmaximum int(config.screen_width * 0.75)
Code: Select all
menu:
"This is a custom menu choice (custom)":
# do something
"This is a normal menu choice":
# do something
The default in-game menus have an sprite change when you pass with the mouse over it or click. I want to do the same with the custom one.namastaii wrote:animation?
Code: Select all
imagebutton:
idle "youridleimage.png"
hover "yourhoverimage.png"
Code: Select all
imagemap:
ground "ground.png"
idle "idle.png"
hover "hover.png"
hotspot(20,20,20,20) action #something
Code: Select all
style.menu_choice_custom_button.hover_background="image.png"
Perfect! Thank you for your help!namastaii wrote:yes you can do it for both hotspots and imagebuttons.I think is what you're looking forCode: Select all
style.menu_choice_custom_button.hover_background="image.png"
Users browsing this forum: No registered users