mms wrote:I tried the first, with defining sprites, and it shows two images when I want to show only one next to the message box. Since I want to show only side-images with these two characters without using the full sprites, it's now working.
As for the ConditionSwitch, how could it be used to show the side-images?
Yeah, that's the problem. ShowingSwitch is only used when showing both full-sized sprites and side images. Very overrated, too.
If you want to use just the side-image, here's an example:
Code: Select all
$ a = Character(
'Alle',
color="#ffe38b",
window_right_padding=160,
show_side_image=ConditionSwitch(
"a_mood = 'serious'", "alle_serious.png",
"a_mood = 'smile'", "alle_smile.png",
"a_mood = 'shock'", "alle_shock.png",
"a_mood = None", "alle_neutral.png",
xalign=0.0, yalign=1.0))
And later, in your script, you can change emotions like this:
Code: Select all
$ a_mood = None
a "Hi!"
b "You suck."
$ a_mood = "shock"
a "Whaaat!?"
Make sure you initialize the "a_mood" variable as None in an init block.
Alternatively, you can make a new character for every mood and not use a Condition switch, which might save your fingers some typing:
Code: Select all
$ a = Character(
'Alle', color="#ffe38b",window_right_padding=160,
show_side_image=Image("alle_serious.png",xalign=0.0, yalign=1.0))
$ a shock = Character('Alle', show_side_image=Image("alle_shock.png",xalign=0.0, yalign=1.0), kind=a)
$ a serious = Character('Alle',show_side_image=Image("alle_serious.png",xalign=0.0, yalign=1.0), kind=a)
$ a smile = Character('Alle', show_side_image=Image("alle_smile.png",xalign=0.0, yalign=1.0), kind=a)
"kind=a" will copy the character a, and only change the attributes you didn't define in the new character, so you'd only have to make changes to the character "a" to make changes to all the "a" emotions chars.