[Script] [ACE] [Message] Neo-Face System 2.0 - Facesize bao nhiêu tùy thích

nhoxboy73nhoxboy73 Posts: 776Registered
Neo-Face System 2.0

GIỚI THIỆU
Bình thường 1 face bị giới hạn là 96x96, vậy với script này, bạn sẽ không bị giới hạn nữa~
Muốn bỏ size bao nhiêu cũng ok :081A:

SCREENSHOT
No need~

DEMO
Scoll to script plzz~

SCRIPT:

#==============================================================================
# NeoFace System v.2.0 [RMVXA Script]
#------------------------------------------------------------------------------
# by Woratana [woratana@hotmail.com]
# Thaiware RPG Maker Community
# Special Thanks: Rabu
# Simple (and still beta) conversion to RMVXA by Vladitor
#------------------------------------------------------------------------------
# Released on: 22/01/2008
# - Put face graphics in folder "face" of your project.
# [New Features in Version 2.0]
# - Auto arrange face position (You can use any size of face file)
# - Call Script "$game_message.side = (number)" to switch show face mode.
# $game_message.side = 0 << switch to normal face system (default face system of RMVX)
# $game_message.side = 1 << switch to NeoFace system (show face in left side)
# $game_message.side = 2 << switch to NeoFace system (show face in right side)
# Default system when you first setup this script is 1
# THESE NUMBERS & RESULTS ARE DIFFERENT FROM VERSION 1.0 #
# Fixed bug in Show Choice command.
#==============================================================================
#==============================================================================
# Window_Base
#------------------------------------------------------------------------------
#==============================================================================
class Window_Base
  def draw_face2(face_name, x, y)
    @face.z = 201
    @face.bitmap = Cache.face(face_name)
    if $game_message.side == 1
    @face.mirror = false
    @face.x = x + 6
    else
    @face.mirror = true
    @face.x = x + (538 - @face.width)
    end
    @face.y = y - (@face.width - 123)
    @face.opacity = 0 # Change 0 to 255 to turn off face's fade in effect.
  end
  
end
#==============================================================================
# Window_Message
#------------------------------------------------------------------------------
#==============================================================================
class Window_Message < Window_Base
  
  alias msg_ini initialize
  def initialize
    msg_ini
    @face = Sprite_Base.new
    $game_message.side = 0 # Default face's side when game start~ (default: 1)
    @default_conx = 0
    @previous = ""
    get_x_face
    # Move text left (-) or right (+) when there's face in right side or no face (default: 0)
  end
  
  def no_face?
    $game_message.face_name.empty?
  end
  
  def clear_face
    if @face.bitmap
          @face.dispose
          @face = Sprite_Base.new
    end
  end
  def new_page(text, pos)
    contents.clear
    clear_face
    if no_face?
          @contents_x = @default_conx
          @previous = ""
    else
          name = $game_message.face_name
          index = $game_message.face_index
          if $game_message.side == 0 ##
            draw_face(name, index, 0, 0)
          else
            draw_face2(name, self.x, self.y)
          end
          @face.opacity = 255 if name==@previous
          @previous = name
          get_x_face
          @contents_x = @fx
    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 new_line_x
    no_face? ? 0 : @fx
  end
  def update
    super
    update_all_windows
    update_back_sprite
    update_fiber
    if @face.opacity < 255 and @face.bitmap
          @face.opacity += 20 # Speed up face's fade in by increase this number
    end
  end
  
  alias close_neo_face close
  def close
    clear_face
    close_neo_face
  end
  def get_x_face
    case $game_message.side
    when 0
          @fx = 112
    when 1
          @fx = @face.width
    when 2
          @fx = @default_conx
    else
          @fx = @default_conx
    end
  end
end # Class
#==============================================================================
# Window_ChoiceList: prevent choices from being obscured by face
#------------------------------------------------------------------------------
#==============================================================================
class Window_ChoiceList < Window_Command
  alias update_placement_neo_face update_placement
  def update_placement
    update_placement_neo_face
    if $game_message.side == 2 and not @message_window.no_face?
          self.x = 0
    else
          self.x = Graphics.width - width
    end
  end
  
end
#==============================================================================
# Game_Message: + store side variable
#------------------------------------------------------------------------------
#==============================================================================
class Game_Message
  attr_accessor :side
end
#==============================================================================
# END NeoFace System
# by Woratana (woratana@hotmail)
#==============================================================================
HƯỚNG DẪN

Bỏ vô, chạy game, Import face, khi tạo khung lời thoại thì chọn góc trái trên cùng của face.

CREDIT
By Woratana and Rabu

SOURCE:
RPG MAKER VX ACE
Sign In or Register to comment.