Automatically composite images define

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Automatically composite images define

#1 Post by akakyouryuu »

config.automatic_images and config.automatic_images_strip can cause Ren'Py to automatically define images.
But composite images aren't defined by this.

I added two config variables config.automatic_images_parts and config.automatic_images_not_necessary_parts which cause Ren'Py to automatically define composite images.


# config.automatic_images_parts = None
#
# If this and `config.automatic_images` are not None, this causes Ren'Py
# to automatically also define composite images.
#
# When not set to None, this should be set to a list of strings giving
# directories that include images which are parts of composite images.
#
# Parts are composited from left to right and all parts must be same size.
#
# config.automatic_images_not_necessary_parts = []
#
# A list of strings giving directories including images which are not
# necessary parts for composite images.
#
# For example, if relative variables are set like below:
#
# * config.automatic_images = ["/"]
# * config.automatic_images_parts = ["body", "face", "sweat", "surplus"]
# * config.automatic_images_not_necessary_parts = ["sweat"]
#
# and your game directly contains, :
#
# * eileen/body/b1.png
# * eileen/body/b2.png
# * eileen/face/f1.png
# * eileen/face/f2.png
# * eileen/sweat/sweat.png
#
# then below images are defined :
#
# * eileen b1 f1
# * eileen b1 f1 sweat
# * eileen b1 f2
# * eileen b1 f2 sweat
# * eileen b2 f1
# * eileen b2 f1 sweat
# * eileen b2 f2
# * eileen b2 f2 sweat

I tried this by Ren'Py v6.17 and this code is public domain.
Attachments
auto_image_define.rpy
(4.54 KiB) Downloaded 189 times

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Automatically composite images define

#2 Post by OokamiKasumi »

akakyouryuu wrote:

Code: Select all

# config.automatic_images_parts = None
#
#     If this and `config.automatic_images` are not None, this causes Ren'Py
#     to automatically also define composite images.
#
#     When not set to None, this should be set to a list of strings giving
#     directories that include images which are parts of composite images.
#
#     Parts are composited from left to right and all parts must be same size.
#
# config.automatic_images_not_necessary_parts = []
#
#     A list of strings giving directories including images which are not
#     necessary parts for composite images.
#
#     For example, if relative variables are set like below:
#
#     * config.automatic_images = ["/"]
#     * config.automatic_images_parts = ["body", "face", "sweat", "surplus"]
#     * config.automatic_images_not_necessary_parts = ["sweat"]
#
#     and your game directly contains, :
#
#     * eileen/body/b1.png
#     * eileen/body/b2.png
#     * eileen/face/f1.png
#     * eileen/face/f2.png
#     * eileen/sweat/sweat.png
#
#     then below images are defined :
#
#     * eileen b1 f1
#     * eileen b1 f1 sweat 
#     * eileen b1 f2
#     * eileen b1 f2 sweat 
#     * eileen b2 f1
#     * eileen b2 f1 sweat 
#     * eileen b2 f2
#     * eileen b2 f2 sweat
Ren'Py v6.17 -- public domain.
With indentations. ;)
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Automatically composite images define

#3 Post by akakyouryuu »

I improved performance.
I added default transforms.

If you define 'default_<image tag name>', the transform is applied to the composite images with the tag. For example, if you define default_eileen transform like below,

Code: Select all

transform default_eileen:
    xanchor .5
this transform is applied to composite images with 'eileen' tag.
Attachments
auto_image_define.zip
(2.28 KiB) Downloaded 133 times

Post Reply

Who is online

Users browsing this forum: No registered users