How to make a picture always visible?

J_C

Veteran
Veteran
Joined
Jan 21, 2015
Messages
192
Reaction score
45
First Language
Hungarian
Primarily Uses
N/A
Hi!


I'm trying to make a HUD system, using pictures as the HUD buttons. My problem is, if there is a map which is covered in darkness (using Victors's light script), the HUD pictures are also go dark, and are barely visible. Is there a way to make a picture always visible, regardless of the lightning of a map?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
If you use a script to darken the map, and don't want that script to darken pictures, then that script needs to be modified (unless it already has that option and you only missed it in the script description.


So please provide a link to the website where that script and its description are posted (in case of Victor's scripts, please link to the correct site on his blog and not to the repository for his scripts)


I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

J_C

Veteran
Veteran
Joined
Jan 21, 2015
Messages
192
Reaction score
45
First Language
Hungarian
Primarily Uses
N/A
If you use a script to darken the map, and don't want that script to darken pictures, then that script needs to be modified (unless it already has that option and you only missed it in the script description.


So please provide a link to the website where that script and its description are posted (in case of Victor's scripts, please link to the correct site on his blog and not to the repository for his scripts)


I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Victor's script is right here:


https://victorenginescripts.wordpress.com/rpg-maker-vx-ace/light-effects/


I read the script descriptions, but I haven't found anything about adding an exception to the light/darkness effect.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Images are drawn into viewports on the screen.  By default, there are 3 viewports.


Viewport 1 has the map and the characters


Viewport 2 has the weather, timer and pictures


Viewport 3 has the screen flash


Anything that's done to the higher viewport numbers will also affect the lower ones (so screen flash will affect the map, characters, weather, timer and pictures).


Victor has placed the lighting effects on viewport 2, with a z-index of 100, which places it in front of everything else on viewport 2.  If you want the pictures to appear in front of the light effect, find this section in the script:

Code:
class Sprite_Light < Sprite_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :lights
  #--------------------------------------------------------------------------
  # * initialize
  #--------------------------------------------------------------------------
  def initialize(shade, viewport)
    super(viewport)
    @shade = shade
    self.bitmap     = Bitmap.new(Graphics.width, Graphics.height)
    self.blend_type = @shade.blend
    self.opacity    = @shade.opacity
    self.z = 100
    @lights = {}
  end
and change self.z to 0 instead of 100.  Note that this could affect how the weather, timer and ALL pictures appear in relation to the light effects, so it might not be quite what you're after either.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
The pictures (default ones) and the lights from Victor's script use @viewport2 from the Spriteset_Map class, but the lights' Z value is set to 100, which means those will appear above any pictures, because the lowest indexed picture got 1 for it's Z value and the highest indexed picture's Z value is 100.


What you can try is to lower the lights' Z value to 0 or even -1. This will make them appear below all pictures.


There is only one line like this in Victor's script:


self.z = 100


Change that 100 to 0, see if it works or not.


If you want some pictures to appear above, while some pictures appear below the light/shadow layer, set that Z value to 50, for example.


That would mean that any picture which got the index of 51 or higher will appear above the lights, while the rest will appear below them. Might be useful to know this.


This all assumes that you use the default pictures for your HUD buttons.


If not, it's better to change the Z value of your custom made sprites to something higher (and if needed, set their viewport's Z level higher too).
 
  • Like
Reactions: J_C

J_C

Veteran
Veteran
Joined
Jan 21, 2015
Messages
192
Reaction score
45
First Language
Hungarian
Primarily Uses
N/A
Thank you both, this was it. It works perfectly.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top