Matt_D wrote:I'm sure this is either a: impossible (or just way to difficult for me to think about) or b: really easy and asked a million times.
I'm possibly just missing something really obvious, but I don't think it's either of those, really. I think it's more likely c: possible, but requiring some understanding of i) how Ren'Py works past the ren'py-script and ii) Python. Maybe that comes under the first option...
My understanding of both of those things comes under the heading of 'working, but flawed', so I'm probably missing something really obvious that would make this easier, but I came up with the following which at least
works...
Put this code inside an init block:
Code: Select all
python:
renpy.store.centreTextValue = "-"
def centreText(st, at):
return Text(renpy.store.centreTextValue,size=50,yalign=0.5, xalign=0.5, drop_shadow=(2,2)), None
def showCentreText(text, pauseTime = 1.0):
renpy.store.centreTextValue = text
renpy.show('centreTextDisplayable')
renpy.with(dissolve)
renpy.pause(pauseTime)
renpy.hide('centreTextDisplayable')
renpy.with(dissolve)
image centreTextDisplayable = DynamicDisplayable(centreText)
Then call it in your script like this:
Code: Select all
e "Hey, let's have some text appearing right in the middle of the screen!"
$ showCentreText("Some Text")
e "Yeah, just like that!"
$ showCentreText("Just Like That", 5.0)
e "... Okay, that one lasted too long."
I'm sure I've directly 'show'ed a Displayable before, which would make this a lot simpler and less hacky, but I can't remember how...