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.

How do i change the players opacity?

Status
Not open for further replies.
Title says it all. How do i change the players opacity? Is it a global variable or do i need to define a local one?

I understand that i need to use "blah.opacity = 200"
but what is the "blah"...?

Thanks in advance.
 

poccil

Sponsor

First, add the following to an empty script section:
Code:
class Game_Character
  attr_accessor :opacity
end

Then, to change the player's opacity:

Code:
$game_player.opacity=128 # 50% opaque
 
or you can do it with an event, just click move event at the first part of the game, then make sure it is on player. Go to the thing that says Opacity Change and once you have selected it, click ok.
 
Thank you to both of you. Yes, i had already thought of the event command but i'm dealing with terrain tags in the script i'm creating so i didn't want an event for every single tile on the map.  ;D
So i was looking for a way to do it with scripting. Thanks again, i have it working now.
 
Status
Not open for further replies.

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