[SOLVED!] With Renpy theme, any way to change/use multiple colors for Button using tags?

OhWee

Forum Fanatic
Modder
Game Developer
Jun 17, 2017
5,735
29,133
@anne O'nymous

Thank you for that example of using the AlphaMask with a background color (Solid)!


sooooo all the im.MatrixColor stuff could be avoided by just using an AlphaMask X_x and it looks so simple... hmmmmm
My only concern with that might be that the mask might have more CPU overhead than changing the color. I don't really know though, just a theory...

Both are quite useful though, now that we have decent coding examples!
 
  • Like
Reactions: Palanto

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,426
15,333
Thank you for that example of using the AlphaMask with a background color (Solid)!
You're welcome.


My only concern with that might be that the mask might have more CPU overhead than changing the color. I don't really know though, just a theory...
It's the opposite. im.matrix will perform matrix calculations over the image, while the alpha mask will just combine the color of two pixels (basically two divisions then an addition). Therefore, the alpha mask rely on natural instructions of the CPU, while the matrix calculations have to simulate most of its operations, breaking them down to the four primary operators (and so natural instructions).
Anyway, nowadays both alpha mask and matrix calculations are basic operations for pictures. So, like Ren'py rely on openGL/directX, which themselves rely on the GPU, it's probably atomic (or not so far) because the GPU probably have dedicated instructions for that.
 
  • Like
Reactions: OhWee