This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


Renpygame

Renpygame is a framework that allows pygame games to be integrated with Ren'Py. It's intended for people who are capable programmers. The philosophy of renpygame is to provide a minimal layer over pygame, and to rely on the programmer to reset things he changes.

To try out renpygame, download the renpygame demo from the Frameworks page, and unpack it inside a Ren'Py You can then select the renpygame-demo project from the launcher, launch it, and see an example of Ren'Py integrated with one of the pygame demo games.

To use renpygame in your own project, copy the renpygame directory from the base directory of the renpygame-demo project into the base directory of your own project. The base directory is the directory above the game directory, the directory that contains the game directory.

Porting Pygame Code

To use renpygame, you need to change imports of pygame to imports of renpygame. For example, the code:

import pygame
from pygame.locals import *

would become

import renpygame
import renpygame as pygame
from renpygame.locals import *

The code can then be used mostly unchanged.

Renpygame expects that the renpygame.display.set_mode function will be called whenever we switch from Ren'Py to renpygame. It's up to the user to take a look at _preferences.fullscreen and set the FULLSCREEN flag as appropriate. For example:

init python:

   import renpygame
   import renpygame as pygame
   from renpygame.locals import *

   def set_mode():
        if _preferences.fullscreen:
            fsflag = FULLSCREEN
        else:
            fsflag = 0

        screen = renpygame.display.set_mode((800, 600), fsflag, 32)
        return screen

Supported Modules

The following modules are supported:

Functions that take a file have been modified so that the files are searched for in archives (except for Fonts), and in the game directory.

Renpygame