Two methods of rendering custom displayables

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
Eliont
Regular
Posts: 111
Joined: Thu Aug 06, 2009 6:51 am
Completed: Begin of Evangelion, SAO - Smile of the black cat, SAO - Project "Ceramic Heart", Time for Dragons
Location: Russia
Contact:

Two methods of rendering custom displayables

#1 Post by Eliont »

Hello and good time of day.

What difference between method #1 and method #2 ?:

Code: Select all

    def render(self, width, height, st, at):    
      # 1 
      render = renpy.Render(self.xsize, self.ysize)
      render.place(self.sprite)
      # renpy.redraw(self, 0.0)
      
      # 2
      # child_render = renpy.render(self.sprite, width, height, st, at)
      # self.width, self.height = child_render.get_size()
      # render = renpy.Render(self.width, self.height)
      # render.blit(child_render, (0, 0))

      return render

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Two methods of rendering custom displayables

#2 Post by gas »

The subject is debatable as we must understand the code logic applied by the core designer.
To my understanding of the thing, the second was implemented to open for users the chance of having both a generic Displayable that control the behaviour of the object, and a child of it (the rendered image), creating the base for the UDD.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Eliont
Regular
Posts: 111
Joined: Thu Aug 06, 2009 6:51 am
Completed: Begin of Evangelion, SAO - Smile of the black cat, SAO - Project "Ceramic Heart", Time for Dragons
Location: Russia
Contact:

Re: Two methods of rendering custom displayables

#3 Post by Eliont »

Btw, is there somewhere extensive guide for UDD (ever if it paid) ?
Not the "proof of concept" that resides in https://www.renpy.org/doc/html/udd.html

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Two methods of rendering custom displayables

#4 Post by zmook »

I've seen a lot of references to "UDD" but can't find a definition. Is it the same thing as "Creator-Defined Displayable"? ("User-Defined"?)
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Two methods of rendering custom displayables

#5 Post by gas »

zmook wrote: Tue Feb 16, 2021 1:05 pm I've seen a lot of references to "UDD" but can't find a definition. Is it the same thing as "Creator-Defined Displayable"? ("User-Defined"?)
I dunno why, but is the same thing that changed name thru time. Probably as by "user" someone meant the one playing the game, and "creator" the one that's doing it.

====
As for the OP: a CDD/UDD is nothing but a PyGame child class, so to use it the best way is to learn how PyGame work.
You don't have to render directly or create a controller for state, but once you know how to manipulate a PyGame object, you own the proper know how.
Is a vast subject, and not really well documented as Renpy wasn't mean to use it a lot.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], NoFanru