Quote from: Subsonic_Noise on February 06, 2010, 11:43:03 am
1. Would be awesome, since I'll have the window at low / zero opacity most of the time, fading text would be good, too.^^
2. Thanks. Sorry for requesting difficult stuff, lol
3. Thanks, but you don't need to implement it with the script call, I just need the same colour for everything.^^
1. Okay, I already started working on it, and (besides the text opacity, dunno why that doesn't work) this part is almost done.
2. Not a problem.
3. Then you would change "system_color" to something like
Color.new(0, 5, 255, 255)
EDIT:
I am so stupid. I just remembered that this can change the text opacity. So text will fade, as well.
EDIT 2: Okay, this isn't going to work. If you put text with a lower opacity on top of the same text with higher opacity, it won't change.
I recommend having the text on a low opacity (such as 100) and then when the window is fully faded out, it'll disappear.
What I have so far:
#==============================================================================
# ** Now Playing by LilBrudder917
#------------------------------------------------------------------------------
# This window displays which music is being played now.
#
# TO USE:
# Use "Call Script" and add
#
# "$lmusic = ["SONG TITLE"]
# $lauthor = ["AUTHOR/BAND NAME"]
# $lalbum = ["ALBUM TITLE"]
# @nowplaying = Window_LMusic.new
# @nowplaying.x = 2
# @nowplaying.y = 2
# @nowplaying.opacity = $game_variables[1]"
#
# Of course, you can change the X and Y positions as you please, aswell as
# the variable ID.
#
#
# To remove the Window, use "Call Script" and add
#
# "@nowplaying.dispose
# @nowplaying = nil"
#
#==============================================================================
$lmusic = []
$lauthor = []
$lalbum = []
class Window_LMusic < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(2, 2, 400, 115)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = Color.new(0, 5, 0, 100)
self.contents.draw_text(4, 0, 1200, 32, "Now Playing: " + $lmusic.to_s)
self.contents.draw_text(4, 20, 120, 32, "by " + $lauthor.to_s)
self.contents.draw_text(4, 40, 1200, 32, "from the album " + $lalbum.to_s)
self.contents.font.color = normal_color
fade
end
if defined?(SDK)
raise "SDK's fault, I swear."
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
refresh
end
def fade
Graphics.update
Graphics.update
Graphics.update
Graphics.update
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 255
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 230
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 205
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 180
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 155
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 130
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 105
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 80
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 55
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 30
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 5
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.opacity = 0
Graphics.update
Graphics.update
Graphics.update
Graphics.update
self.contents.dispose
end
end
The fade effect pretty much ruins the variable opacity, but if you want it to start on a lower opacity (155, for example), remove everything below (and including) "self.opacity = 255" up until the line above "self.opacity = 155", for example.