Thanks for demonstrating!...m_from_space wrote: ↑Wed Mar 13, 2024 8:42 am
So not using style definitions for background, you could also achieve different backgrounds using this variable. This method is really not necessary for just a different background. I just want to demonstrate it.
I am always very grateful for any input!
Yes!... THAT is exactly what I wanted, just different bg-images with one transparency slider for ALL (so for the "Say screen" AND ALL in the "Multiple Say screen".) So far so good ... but !!![...] But of course you can also only use 1 persistent variable that changes all the screens.
Code: Select all
default persistent.bg_opacity1 = 1.0 default persistent.bg_opacity2 = 1.0 style block1_multiple2_say_window is multiple2_say_window: background Transform(Frame("mybg1", xalign=0.5, yalign=1.0), alpha=persistent.bg_opacity1) style block2_multiple2_say_window is multiple2_say_window: # make sure the screen is drawn with an offset, otherwise it will overlap the other one, don't put the offset into the background! xoffset 500 background Transform(Frame("mybg2", xalign=0.5, yalign=1.0), alpha=persistent.bg_opacity2)
And I was quite sure that this was the solution ... but, I still have the problem that the two bg-images for both "block1_multiple2_say_window" and "block2_multiple2_say_window" are displayed but you can't change the transparency.
Somehow it ignores the "alpha=persistent.dialogueBoxOpacity" ... I don't know.
Probably I have an error somewhere ?
I'll post the code again. it does NOT work in the simple Say screen as soon as I change the line from--->
Code: Select all
window:
id "window"
background Transform(Frame("gui/textbox/textbox_mul.webp",xpos=580, yalign=1.0), alpha=persistent.dialogueBoxOpacity)
if who is not None:
[...]
style block1_multiple2_say_window is multiple2_say_window:
xoffset -1260
yoffset -50
Code: Select all
window:
id "window"
if who is not None:
[...]
style block1_multiple2_say_window is multiple2_say_window:
background Transform(Frame("gui/textbox/textbox_lu.webp",xpos=580, yalign=1.0), alpha=persistent.dialogueBoxOpacity)
xoffset -1260
yoffset -50
I'll post the complete code:
Code: Select all
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
# Add a Sideimage to the Namebox
add SideImage():
xalign 0.0 yalign 0.5
xoffset -230
text what id "what"
## Make the namebox available for styling through the Character object.
init python:
config.character_id_prefixes.append('namebox')
style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue
style namebox is default
style namebox_label is say_label
style window:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize 600
background Transform(Frame("gui/textbox/textbox.webp", xalign=0.5, yalign=1.0), alpha=persistent.dialogueBoxOpacity)
style namebox:
xpos 500 #gui.name_xpos
xanchor gui.name_xalign
xsize gui.namebox_width
ypos -175 #gui.name_ypos
ysize gui.namebox_height
padding gui.namebox_borders.padding
style say_label:
properties gui.text_properties("name", accent=True)
xalign gui.name_xalign
yalign 0.5
style say_dialogue:
properties gui.text_properties("dialogue")
xpos 600 #gui.dialogue_xpos (884)
xsize 2792 #gui.dialogue_width (2232)
ypos 195 #150 +45
adjust_spacing False
## Multiple Say Screen #########################################################
##
## This screen sets up the Multiple_say_screen and adds an Sideimage next to
## the "namebox"
screen multiple_say(who, what, multiple):
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
hbox:
add side_images_reference[who]:
xalign 0.0 yalign 0.5
xoffset 55 #xoffset -30
text who id "who"
text what id "what"
#####################################################################
## Multiple 2
style multiple2_say_window is say_window: # saywindow (hgBild) - position
xsize 1480
ysize 390
style multiple2_namebox is namebox: # Namebox - position
ypos -28
xoffset -200
style multiple2_say_label is say_label: # Namebox - Text - position
xoffset 90
style multiple2_say_dialogue is say_dialogue: # Textbox - Text - position
xsize 1400
xoffset 87
yoffset -55
style block1_multiple2_say_window is multiple2_say_window:
background Transform(Frame("gui/textbox/textbox_lu.webp",xpos=580, yalign=1.0), alpha=persistent.dialogueBoxOpacity)
xoffset -1260
yoffset -50
style block2_multiple2_say_window is multiple2_say_window:
background Transform(Frame("gui/textbox/textbox_ru.webp",xpos=580, yalign=1.0), alpha=persistent.dialogueBoxOpacity)
xoffset 460
yoffset -50
Code: Select all
define persistent.dialogueBoxOpacity = 0.2
So somehow the "persistent.dialogueBoxOpacity" value doesn't work for me at this position.