cc_screen
Code: Select all
define character_img = "base.png"
screen character_customization_screen:
modal True
tag menu
# The main menu buttons.
frame:
xalign .7
yalign .5
has vbox
hbox:
vbox:
$ ui.text("Hair styles", size= 23,color="#496682")
textbutton _("hairstyle1") action [ SetVariable("hairstyle1","hair1.png")]
textbutton _("hairstyle2") action [ SetVariable("hairstyle2", "hair2.png")]
textbutton _("hairstyle3") action [ SetVariable( "hairstyle3","hair3.png")]
textbutton _("hairstyle4") action [ SetVariable( "hairstyle4","hair4.png")]
textbutton _("hairstyle5") action [ SetVariable( "hairstyle5","hair5.png")]
textbutton _("hairstyle6") action [ SetVariable( "hairstyle6","hair6.png")]
add character_img:
pos (-60,81)
Code: Select all
init:
## CHARACTER APPEARANCE ##
$ body = "base"
$ hairstyle1 = "hair1"
$ hairstyle2 = "hair2"
$ hairstyle3 = "hair3"
$ hairstyle4 = "hair4"
$ hairstyle5 = "hair5"
$ hairstyle6 = "hair6"
Code: Select all
init python:
hair = 1
def draw_character(st, at): # combine the dressup items into one displayable
return LiveComposite(
(361, 702), # image size
(0, 0), "base.png",
(0, 0), "hair%d.png"%hair,
),.1
init:
image character = DynamicDisplayable(draw_character)
screen character_customization_screen:
modal True
tag menu
frame:
xalign .7
yalign .5
has vbox
hbox:
vbox:
$ ui.text("Hair styles", size= 23,color="#496682")
textbutton _("hairstyle1") action [ SetVariable("hair", 1)]
textbutton _("hairstyle2") action [ SetVariable("hair", 2)]
textbutton _("hairstyle3") action [ SetVariable( "hair", 3)]
textbutton _("hairstyle4") action [ SetVariable( "hair", 4)]
textbutton _("hairstyle5") action [ SetVariable( "hair", 5)]
textbutton _("hairstyle6") action [ SetVariable( "hair", 6)]
textbutton "OK" action Return() xpos 100 ypos 100
add "character":
pos (-60,81)