Changing window transparency in game

Good Morning / Day / Afternoon / Evening everyone.

I have a request for a script snippet.

Is it possible to code a snippet that allows me change the transparency of a window via a script call in game?

my windows are opaque by default with this code

Ruby:
class Window_Base < Window
  alias solidify_initialize initialize
  def initialize(x, y, width, height)
    solidify_initialize(x, y, width, height)
    self.back_opacity = 255
  end
end

I would really appreciate this
My lazy solution would be something like this. You use the game variable to control the opacity. Not tested though.
Code:
class Window_Base < Window
  
  alias update_2 update
  def update
    update_2
    self.back_opacity = $game_variables[id] # <-- replace ID with variable id
  end
  
end
This will affect all windows. If you want a specific window, then do tell.
Noob here, but within the event, how do I set this up?

For example... one textbox would be opaque, but the next one would be transparent...

I would like this to only affect the textbox yes.
bump

@Panda_Artist, please do not bump your topic unless it has been 24 hours later since your last post. You can review our forum rules here. Thank you.


Please be patient, nobody is online 24/7 so it's entirely possible that the people who could help you aren't even online right now.
Only for the window message version
Code:
class Window_Message
  
  alias update_2 update
  def update
    update_2
    self.back_opacity = $game_variables[10]
  end
  
end
Noob here, but within the event, how do I set this up?
You set the variable 10 values to 0 ~ 255 to determine the opacity.
Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/changing-window-transparency-in-game.121119/