To unpack a list, Hbox(*[Image("a.png"), Image("b.png")]) should work. I'm using Fixed(*list_of_displayables, fit_first=True).
Works brilliantly. Did not realize that adding a star unpacks a list.
On the problem with centering with LC, here's some sample code I wrote up for testing your suggestions with comments:
Code: Select all
init python:
renpy.image("word", LiveComposite((100, 30), \
(0, 0), "background.png",
(0.5, 0), Text("word")))
label start:
show word:
align (0.0, 0.5)
linear 1.0 xalign 1.0
"..."
LiveComposite: Animation works, text not aligned (xpos is defined as 100*0.5 which is neat though)
Code: Select all
init python:
renpy.image("word", Fixed( \
At("background.png", Position(xysize=(100, 30), pos=(0, 0))), \
At(Text("word"), Position(xysize=(100, 30), xalign=0.5)))
...
Fixed: Animation doesn't work, because Position overrides the ATL statement. I tried other variations like using xcenter but no dice.
Code: Select all
init:
image word:
contains:
"background.png"
contains:
Text("word")
xalign 0.5
...
contains: Same problem with no animation. Transform is dominant over the ATL.
I took a look at PyTom's commit but frankly it doesn't look like it changes much other than how the image is displayed... Well my programming skills are horrible so I never bothered looking into the source code.
I think one workaround may be to declare the text image, grab its width, and then calculate the xpos to align the text from there. I'm uncertain how to get the image width though, but when I find time I'll try to work on this if there's no other solutions.