Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Changing Between Different Opacities

Culex

Member

I have an option menu that changes between different opacities (let's say 200 for transparent and 255 for opaque). How can I make a certain number the defining number for the system's opacity? I'm hoping that makes sense.

Here's what I've tried:

I added an attr_accessor in Game_System and then went below into the def initialize method and added @window_opacity = 255. Then I had this in my Scene_Option script:

Code:
[...]
case @opacity_window.index
      when 0  # Transparent
        $game_system.se_play($data_system.decision_se)
        $game_system.window_opacity = 200 # For transparent
        @dummy_window.opacity = 200 # To change the current scene's window opacity
      when 1  # Opaque
        $game_system.se_play($data_system.decision_se)
        $game_system.window_opacity = 255 # For opaque
        @dummy_window.opacity = 255 # To change the current scene's window opacity
      end
[...]
However, when I select a command it comes up with an error about "integer conversion implicity" or something like that. So obviously I'm going about this wrong.

Help is appreciated and credit is given where credit is due, of course. ^_^
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top