Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # [VX] Center Message Alignment with Fade In
- # Author: DrDhoom
- # Date: 06-04-2013
- class Window_Message < Window_Selectable
- def update_message
- loop do
- c = @text.slice!(/./m) # Get next text character
- case c
- when nil # There is no text that must be drawn
- finish_message # Finish update
- break
- when "\x00" # New line
- update_display_text
- @text_display = ""
- new_line
- if @line_count >= MAX_LINE # If line count is maximum
- unless @text.empty? # If there is more
- self.pause = true # Insert number input
- break
- end
- end
- when "\x01" # \C[n] (text character color change)
- @text.sub!(/\[([0-9]+)\]/, "")
- contents.font.color = text_color($1.to_i)
- next
- when "\x02" # \G (gold display)
- @gold_window.refresh
- @gold_window.open
- when "\x03" # \. (wait 1/4 second)
- @wait_count = 15
- break
- when "\x04" # \| (wait 1 second)
- @wait_count = 60
- break
- when "\x05" # \! (Wait for input)
- self.pause = true
- break
- when "\x06" # \> (Fast display ON)
- @line_show_fast = true
- when "\x07" # \< (Fast display OFF)
- @line_show_fast = false
- when "\x08" # \^ (No wait for input)
- @pause_skip = true
- else # Normal text character
- @text_display = "" if @text_display == nil
- @text_display += c
- end
- end
- end
- def update_display_text
- @color = contents.font.color.clone
- @color.alpha = 0
- Sound.play_cursor
- loop do
- if @show_fast or @line_show_fast
- @color.alpha = 255
- end
- Graphics.update
- Input.update
- update_show_fast
- contents.clear_rect(0,@contents_y, contents.width, WLH)
- @color.alpha += 16
- contents.font.color = @color
- contents.draw_text(0, @contents_y, contents.width, WLH, @text_display,1)
- if @color.alpha == 255
- break
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement