Marking a deep child for redraw [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
ChesStrategy
Regular
Posts: 96
Joined: Wed Jan 14, 2015 7:01 pm
Contact:

Marking a deep child for redraw [solved]

#1 Post by ChesStrategy »

Hi all,

I currently have a hierarchy of nested displayables; something similar to this example:

Code: Select all

# inside UDD
self.children = [ Transform(), Transform() ]

def render( ... ):
    
    for child in self.children:
        ...create our_render...
        ...call renpy.render() on each child...
        ...blit to our_render...

renpy.redraw( self, 0 )
return our_render

# inside Transform #1:
self.child = Fixed()

# inside fixed():
self.children = [ UDD(), UDD(), UDD() ]
... and it could go on and on...

From our debug output; it looks like renpy.Render() caches some results and does not always run the all of the decendents' render() functions. We know this since we have a renpy.log() debug call inside one of our deep UDDs' render() functions.

Is there a way I can get renpy.Render() to re-render a child deep in the hierarchy without explicitly calling renpy.redraw() on that child? I may not have access to it from the topmost UDD. Maybe there is way to set a dirty flag on the immediate child?

For the deep UDDs, I'm not worried about calling render() every single time, since I'm doing my own caching of children there. (So no performance concerns; in case someone is wondering)

Regards,
Ches
Last edited by ChesStrategy on Tue Dec 15, 2015 5:34 pm, edited 1 time in total.

ChesStrategy
Regular
Posts: 96
Joined: Wed Jan 14, 2015 7:01 pm
Contact:

Re: Marking a deep child for redraw

#2 Post by ChesStrategy »

We've refactored a decent amount of our codebase into several different UDDs that rely on the render() function to be called; so here's to hoping for a cool solution :D rather than more refactoring... :cry:

ChesStrategy
Regular
Posts: 96
Joined: Wed Jan 14, 2015 7:01 pm
Contact:

Re: Marking a deep child for redraw [solved]

#3 Post by ChesStrategy »

This might be due to a nasty, hidden bug in our code; marking as solved temporarily

Post Reply

Who is online

Users browsing this forum: No registered users