Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Character instead of Faces
- #
- # Do note that your Actor Face image and your Actor Sprite
- # image must be named the same and in the same order.
- module Customization
- module Window_Message
- USE = true
- DIRECTION = 0 # Default 0
- ZOOM = 2.5 # Default 2.5
- X_OFFSET = 50 # Default 50
- Y_OFFSET = 80 # Default 80
- end
- end
- # DO NOT EDIT BEYOND THIS POINT!
- class Window_Message
- attr_reader :frame
- attr_reader :frame_counter
- alias :kurashi_message_window_initialize :initialize
- def initialize
- kurashi_message_window_initialize #(0, 0, window_width, window_height)
- end
- def new_page(text, pos)
- contents.clear
- if Customization::Window_Message::USE
- draw_character($game_message.face_name, $game_message.face_index,
- Customization::Window_Message::X_OFFSET,
- Customization::Window_Message::Y_OFFSET, 1)
- else
- draw_face($game_message.face_name, $game_message.face_index, 0, 0)
- end
- reset_font_settings
- pos[:x] = new_line_x
- pos[:y] = 0
- pos[:new_x] = new_line_x
- pos[:height] = calc_line_height(text)
- clear_flags
- end
- #~ def draw_face(face_name, face_index, x, y, enabled = true)
- #~ bitmap = Cache.face(face_name)
- #~ rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
- #~ contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
- #~ bitmap.dispose
- #~ end
- def draw_character(character_name, character_index, x, y, frame = 1)
- return unless character_name
- bitmap = Cache.character(character_name)
- sign = character_name[/^[\!\$]./]
- if sign && sign.include?('$')
- cw = bitmap.width / 3
- ch = bitmap.height / 4
- else
- cw = bitmap.width / 12
- ch = bitmap.height / 8
- end
- n = character_index
- src_rect = Rect.new((n%4*3+frame)*cw,
- (ch * Customization::Window_Message::DIRECTION)+(n/4*4)*ch,
- cw, ch)
- ret_rect = Rect.new(x - cw, y - ch * Customization::Window_Message::ZOOM,
- cw * Customization::Window_Message::ZOOM,
- ch * Customization::Window_Message::ZOOM)
- contents.stretch_blt(ret_rect, bitmap, src_rect)
- end
- end # Window_Message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement