Choppy transform (subpixel rendering not working?)

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
fullmontis
Regular
Posts: 129
Joined: Sun May 05, 2013 8:03 am
Deviantart: fullmontis
itch: fullmontis
Location: Italy
Contact:

Choppy transform (subpixel rendering not working?)

#1 Post by fullmontis »

I have a transform that works as follows:

Code: Select all

transform breathing:
    subpixel True
    ypos 720
    yanchor 1.0
    ease 0.4 ypos 723
    ease 1.0 ypos 720
    repeat
I notice that the transform is choppy, meaning that you can see the sprite jump from one pixel to another when rendered. Since I used subpixel rendering I thought this would go away, but it is still there.

Is there a solution to make a transform like this more fluid? Thanks :D

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: Choppy transform (subpixel rendering not working?)

#2 Post by PyTom »

Write:

Code: Select all

transform breathing:
    subpixel True
    ypos absolute(720)
    yanchor 1.0
    ease 0.4 ypos absolute(723)
    ease 1.0 ypos absolute(720)
    repeat
If you give it an integer argument, you're only going to get integers. If you give it absolute, you'll get pixel floats, which are needed for such small movements.
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
fullmontis
Regular
Posts: 129
Joined: Sun May 05, 2013 8:03 am
Deviantart: fullmontis
itch: fullmontis
Location: Italy
Contact:

Re: Choppy transform (subpixel rendering not working?)

#3 Post by fullmontis »

Thank you Tom, works perfectly! I didn't know it was possible to pass floats to position arguments, this is really handy :-D

Post Reply

Who is online

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