Animated Textbox with ATL? [solved]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Starzie
Regular
Posts: 25
Joined: Fri Nov 09, 2007 3:19 pm
Projects: Tsrynthia - Seals of Fate
Contact:

Animated Textbox with ATL? [solved]

#1 Post by Starzie »

I'm finally at the point where I've been customizing the look of the game I've been writing on for a few weeks now. Unfortunately, I've hit a snag dealing with the syntax of what I'm trying to do. I want an animated textbox for my narration.

I already know you can change the text box using style.window.background. My question comes from wanting to use an ATL block to customize it even further and give it animation.

Code: Select all

style.window.background = Frame(frame1, 1, 1)
When I try to declare the animation in the script file, Renpy tells me frame1 is not defined. I then realized the options are initialized before my script files.

Code: Select all

image frame1:
    "test01.png"
    pause 0.5
    "test02.png"
    pause 0.5
    repeat

style.window.background = Frame(frame1, 1, 1)
So I dropped the code into the options file, which resulted in Renpy telling me the syntax is wrong. I then realized the options are in Python. So either, what would be the Python equivalent, or how can I initialize that ATL block before the options?

I have this awful feeling I'm missing something obvious, but I've just about tried everything I could think of. Thanks for the help in advance!
Last edited by Starzie on Fri Feb 03, 2012 2:19 pm, edited 1 time in total.

Starzie
Regular
Posts: 25
Joined: Fri Nov 09, 2007 3:19 pm
Projects: Tsrynthia - Seals of Fate
Contact:

Re: Animated Textbox with ATL?

#2 Post by Starzie »

So in my quest to try to answer my own question, I tried this:

Code: Select all

image frame1:
    "test01.png"
    pause 0.5
    "test02.png"
    pause 0.5
    repeat
    
python:
    style.window.background = Frame(frame1, 1, 1)
This is in my script file, with the option's style.window.background commented out. The game actually launched this time!

My newest problem is the image is now simply a black box instead of the animated one I was expecting. Any ideas?

Mild Curry
Regular
Posts: 107
Joined: Fri Jul 02, 2010 3:03 pm
Projects: That's The Way The Cookie Crumbles
Organization: TwinTurtle Games
Contact:

Re: Animated Textbox with ATL?

#3 Post by Mild Curry »

Er...try this:

Code: Select all

style.window.background = Frame(Animation("test01.png", 0.5, "test02.png", 0.5))

Starzie
Regular
Posts: 25
Joined: Fri Nov 09, 2007 3:19 pm
Projects: Tsrynthia - Seals of Fate
Contact:

Re: Animated Textbox with ATL?

#4 Post by Starzie »

Haha, yes that worked. Thank you so much!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]