Selective nearest neighbor filtering

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
User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Selective nearest neighbor filtering

#1 Post by Kinmoku »

Hi all,

I have a pixel art VN I am working on, though some parts of the game are not in that same style. Ideally, I would like to use:

Code: Select all

config.nearest_neighbor = True
...as 90% of the game is pixel art, but the other comic parts look really awful with this filtering. For some comic scenes, I am using:

Code: Select all

    $ config.nearest_neighbor = False
...and then reverting back after the scene has ended, but I have some problems... The protagonist speaks over the pixel art in the comic art style, with this character defined image:

Code: Select all

define t = Character(None, image="emmett", what_xalign=0.4, what_yalign=0.5, window_xpos=680, window_ypos=702, window_xmaximum=969, window_right_padding=150, what_font="fonts/KOMTXTI_.ttf", window_background="bigthought")
There are also main menus and animations I do not want to be set to nearest_neighbor. Is there a way I can set a folder of images to nearest_neighbor? Or something I can add to the character?

Many thanks :)

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Selective nearest neighbor filtering

#2 Post by PyTom »

This is kind of a hard thing to do. Your best bet would be to leave config.nearest_neighbor as false, and perhaps enable it on a per-layer basis. In 7.4.6, this could be as easy as:

Code: Select all

camera:
     nearest True
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Selective nearest neighbor filtering

#3 Post by Kinmoku »

PyTom wrote: Fri Jul 02, 2021 4:45 pm This is kind of a hard thing to do. Your best bet would be to leave config.nearest_neighbor as false, and perhaps enable it on a per-layer basis. In 7.4.6, this could be as easy as:

Code: Select all

camera:
     nearest True
Ah interesting. I will give this some thought... Sounds like a good solution, though!

Post Reply

Who is online

Users browsing this forum: Google [Bot], piinkpuddiin