battlestar_caprica
Member
This should be fairly simple so i'll be quick.
I'm working on a HUD for my game that uses windows with full opacity. However, whenever the player walks behind the HUD, I want the HUD to become transparent.
I already know how to make the opacity change (window.opacity = 150). What I'm asking is how do I check whether the player is walking into the HUD or not so that I can trigger the opacity change.
Here's a picture of what I mean...
http://i61.photobucket.com/albums/h72/R ... /helpo.jpg[/img]
Here's the script... (which does nothing right now besides draw a window)
Any help would be quite appreciated.
Thanks in advance.
I'm working on a HUD for my game that uses windows with full opacity. However, whenever the player walks behind the HUD, I want the HUD to become transparent.
I already know how to make the opacity change (window.opacity = 150). What I'm asking is how do I check whether the player is walking into the HUD or not so that I can trigger the opacity change.
Here's a picture of what I mean...
http://i61.photobucket.com/albums/h72/R ... /helpo.jpg[/img]
Here's the script... (which does nothing right now besides draw a window)
Code:
class Game_Map
attr_reader :map_minimap
alias map_minimap_setup setup
end
class Scene_Map
alias map_minimap_main main
alias map_minimap_update update
def main
#@spriteset_map = Spriteset_Map.new
@message_window = Window_Message.new
# Add name of map to window
@minimap_window = Window_Minimap.new
@minimap_window.opacity = 255
@minimap_window.x = 490
@minimap_window.y = 330
map_minimap_main
@minimap_window.dispose
end
def update
@minimap_window.update
map_minimap_update
end
end
class Window_Minimap < Window_Base
def initialize
super(0, 0, 150, 150)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
end
def update
super
refresh
end
end
Any help would be quite appreciated.
Thanks in advance.