Full screen imagebuttons and performance.

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
Gachapen
Newbie
Posts: 16
Joined: Sat Jan 14, 2023 12:48 pm
Contact:

Full screen imagebuttons and performance.

#1 Post by Gachapen »

I am currently using full resolution, 1920x1080 PNG image buttons with most of the pixels being transparent. I am doing this for the simplicity of positioning them. I create and position them in photoshop against the backgrounds, then export. They are like 98% transparent and only 45kb in size. I then use the same image as the focus mask in instances where a hover is not needed. Everything works great.

My question is, over time will this effect performance, and why? I have noticed slow down in some areas and am wondering if it is because of these buttons. They are mostly transparent and so tiny, so I am unsure how it could be them. Thank you.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2438
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Full screen imagebuttons and performance.

#2 Post by Ocelot »

Yeah, buttons overlapping like that are killing perfomance.

IIRC even if your image is mostly transparent, it will still take a large amount of cache. If you have more than several screen worth of those images (for full screen image it means just several images), they won't fit in cache. And since your buttons take the whole screen, eac time you do something, like move your mouse, it has to go over all images, potentially loading some from disc and test if that pixel is transparent or not.
< < insert Rick Cook quote here > >

Gachapen
Newbie
Posts: 16
Joined: Sat Jan 14, 2023 12:48 pm
Contact:

Re: Full screen imagebuttons and performance.

#3 Post by Gachapen »

Ocelot wrote: Mon Jul 03, 2023 2:41 pm Yeah, buttons overlapping like that are killing perfomance.

IIRC even if your image is mostly transparent, it will still take a large amount of cache. If you have more than several screen worth of those images (for full screen image it means just several images), they won't fit in cache. And since your buttons take the whole screen, eac time you do something, like move your mouse, it has to go over all images, potentially loading some from disc and test if that pixel is transparent or not.
Thank you for the info!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], giorgi1111, Google [Bot]