Code: Select all
init python:
def fadingText(text, xpos=100, ypos=100, size=24, moveX=0, moveY=0, color="#fff"):
for i in xrange(0, 16):
curX = "%x" % (15 - i)
ui.text("{color="+color+curX+"}"+text+"{/color}", xpos=(xpos + moveX * i), ypos=(ypos + moveY * i), size=size)
renpy.pause(1/60)
Code: Select all
$ fadingText("sniff", 400, 300, 24, -2, 1)
The color is unchanged, and thus defaults to white.
This isn't anything too flashy or complicated. It's just text that appears on screen and quickly fades away.
For example, you could use it to show sound effects on screen, either for added effect or in case the player has their sound turned off.
Parameters:
text: the text to be displayed
xpos: the x position at which the text should initially be displayed
ypos: the y position at which the text should initially be displayed
size: the size of the text
moveX: how far to move the text along the X axis each iteration. Negative numbers move left, positive move right. Total movement = 15 x moveX.
moveY: how far to move the text along the Y axis each iteration. Negative numbers move up, positive move down. Total movement = 15 x moveY.
color: color of the text to display