じ☆ve冰风 发表于 2026-8-2 07:59:43

Simple Message Busts

Simple Message Busts v1.0
by Hollow​

Introduction
This script allows the use of large portraits (busts) in place of facesets in message boxes.

Features


[*]Easy to install, and easy to use.
[*]Show more detailed portraits of your characters.

http://i.imgur.com/SD51K2C.png



How to Use:


[*]Create a new script slot below Materials and above Main in the Script Editor.
[*]Copy and paste the script into the new slot.
[*]Adjust the settings to your preferences.
[*]Save all busts to the "Faces" folder.
[*]Enjoy!
:
Image Requirements
Each individual bust must be in its own file, but the bust itself may be any size. In addition, the bust's filename must include the symbol chosen in the settings. If not, the script won't recognize it as a bust, and so it won't display properly in the message box.

Script

Spoiler                Code:       
#==============================================================================
# ** Simple Message Busts
#------------------------------------------------------------------------------
# Engine: RPG Maker VX Ace
# Author: Hollow
#==============================================================================
# * Instructions
#------------------------------------------------------------------------------
#This script allows the use of large portraits (busts) in place of facesets
# in message boxes. All busts should be saved to the "Graphics/Faces" folder,
# and it's file-name must include the symbol chosen in the settings below. To
# use in game, simply select the bust you wish to use in the faceset box of the
# "Show Text" command. The script will do the rest.
#==============================================================================
# ** Settings
#==============================================================================
module HMB
BUST_INDENT = 180         
# Indentation width for text when bust is shown.
BUST_OFFSET = -75         
# Bust image's offset on the x-axis.
BUST_SYMBOL = "!"         
# Symbol to differentiate busts from facesets.
end # HMB
#==============================================================================
# ** Window_Message
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# * Alias
#--------------------------------------------------------------------------
alias hmb_window_message_create_back_bitmap create_back_bitmap
alias hmb_window_message_dispose dispose
alias hmb_window_message_update_back_sprite update_back_sprite
#--------------------------------------------------------------------------
# * Create Background Bitmap
#--------------------------------------------------------------------------
def create_back_bitmap   
    @bust = Sprite.new if @bust.nil?   
    @bust.visible = true   
    @bust.z = z + 1   
    hmb_window_message_create_back_bitmap
end
#--------------------------------------------------------------------------
# * Free
#--------------------------------------------------------------------------
def dispose   
    hmb_window_message_dispose   
    dispose_bust
end
#--------------------------------------------------------------------------
# * Free Bust
#--------------------------------------------------------------------------
def dispose_bust   
    @bust.dispose if !@bust.nil?   
    @bust.bitmap.dispose if !@bust.bitmap.nil?
end
#--------------------------------------------------------------------------
# * Update Background Sprite
#--------------------------------------------------------------------------
def update_back_sprite   
    hmb_window_message_update_back_sprite   
    update_bust if openness > 0
end
#--------------------------------------------------------------------------
# * Update Bust
#--------------------------------------------------------------------------
def update_bust   
    if $game_message.face_name.include?(HMB::BUST_SYMBOL)      
      @bust.bitmap = Cache.face($game_message.face_name)      
      @bust.x = HMB::BUST_OFFSET      
      @bust.y = Graphics.height - @bust.height   
    else      
      @bust.bitmap = nil   
    end   
    @bust.update
end
#--------------------------------------------------------------------------
# * Get New Line Position
#--------------------------------------------------------------------------
def new_line_x   
    if $game_message.face_name.include?(HMB::BUST_SYMBOL)      
      $game_message.face_name.empty? ? 0 : HMB::BUST_INDENT   
    else      
      $game_message.face_name.empty? ? 0 : 112   
    end
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, x, y, enabled = true)   
    return if $game_message.face_name.include?(HMB::BUST_SYMBOL)   
    super
end
end # Window_Message





Terms
Free for non-commercial and commercial use as long as you credit me.


Author's Note
I wrote this up a little while ago for personal use but decided to share since it is pretty simple. I hope you guys can get some good use out of it!


本贴来自国际rpgmaker官方论坛作者:Hollow处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/simple-message-busts.45897/
页: [1]
查看完整版本: Simple Message Busts