[RMMZ] Change the background of buttons?(choice buttons, item buttons ,etc.

I was trying to change the default button background to custom made sprites

From(Background 1 is the one I want to adjust)
1.PNG

to something like this(custom made menu button):
2.PNG


I want to try replace the original rectangle with a sprite. The problem is I don't know where to find the related codes😅(I googled around and didnt find much. Doesn't seem like there're any available plugins too

Any help would be much appreciated!
That's not what the options menu looks like by default, so it's hard to say. My guess would be that it's the dimmer bitmap and you've edited the ColorManager "dim colours" (possibly via a plugin) so that it looks like a solid rectangle rather than the default vertical transparent -> black -> transparent gradient...? Or is it just a different windowskin? 😅

You could try making an override for the refreshDimmerBitmap method of whichever windows you like, replacing the default gradient-rect calls for sprites. Not sure if you need help with how to do that, so I'll just leave this here:
JavaScript:
this._backgroundSprite = ImageManager.loadPicture('menuBack01');
this._dimmerSprite.addChild(this._backgroundSprite);
(You could use blitting instead if you prefer, but I think that would need more code since the image data won't typically be available immediately after requesting it. Sprites auto-refresh when their bitmap loads, so they're easier to use in that respect.)
Uh I don't think I implement this right..
f1.PNG

made this a separate plugin and I got this error:
f2.PNG

I don't know what to do with individual windows
I corrected it but made it like this:
1605219839649.png

But the sprite doesn't change. Still the default one
1605219877731.png
Alright I actually found a way around
What it looks like now:
f3.PNG

Code that I edited(The lines I //out will remove the rectangle thingy behind the texts. Based on the window type, you gotta edit them out in different script sections)
f4.PNG

Dis and with some simple mapping events.
Hopefully this will help people who have similar problems!
(I doubt anyone here is as noobish as me😢

Thank you again @caethyril You helped me a lot!😍
Hey, neat! Looks like it wasn't actually the dimmer after all... 😴

Thanks for sharing the solution! Happy RPG Making~ 😂

Original thread: https://forums.rpgmakerweb.com/threads/rmmz-change-the-background-of-buttons-choice-buttons-item-buttons-etc.129811/