Project1
标题:
關於半身頭像位置問題
[打印本页]
作者:
tsanggrace2002
时间:
2013-10-1 22:15
标题:
關於半身頭像位置問題
本帖最后由 76213585 于 2013-10-17 16:03 编辑
新人請教,自己上網跟範例弄過,但不知為何半身頭像位置是在對話框上方,應該如何令半身頭像位置貼在對話框右下方???
VA圖書館好多圖掛了,也想再請問一下,有沒有合新手用的學習帖??
半身腳本
($imported ||= {})["Galvs_Message_Busts"] = true
module Galv_Bust
#------------------------------------------------------------------------------#
# SCRIPT SETTINGS
#------------------------------------------------------------------------------#
DISABLE_SWITCH = 1 # Turn swith ON to disable busts and show normal face
BUST_Z = -1 # adds to z value of busts if needed. A negative number
# will make the bust appear below the message window.
BUST_Y_OVER = false # can be true or false
# true = busts sit at the bottom of the screen
# false = busts sit on top of the message window
TEXT_X = 0 # Offset text when displaying busts above the message
# window. The script automatically offsets the text x
# by the bust image width IF the BUST_Z is 0 or more.
SLIDE = true # Slide portrait onto the screen instead of fading in.
#------------------------------------------------------------------------------#
# END SCRIPT SETTINGS
#------------------------------------------------------------------------------#
end
class Game_Interpreter
def bust_mirror(state)
$game_message.mirror = state
end
alias galv_busts_command_101 command_101
def command_101
$game_message.bust_name = @params[0]
$game_message.bust_index = @params[1]
galv_busts_command_101
end
end # Game_Interpreter
class Game_Message
attr_accessor :bust_name
attr_accessor :bust_index
attr_accessor :mirror
alias galv_busts_message_initialize initialize
def initialize
galv_busts_message_initialize
[url=home.php?mod=space&uid=111303]@mirror[/url] = false
end
alias galv_busts_message_clear clear
def clear
@bust_name = ""
@bust_index = 0
galv_busts_message_clear
end
end # Game_Message
class Window_Message < Window_Base
alias galv_busts_window_create_back_bitmap create_back_bitmap
def create_back_bitmap
@bust = Sprite.new if @bust.nil?
@bust.visible = true
@bust.opacity = 0
@bust.z = z + Galv_Bust::BUST_Z
galv_busts_window_create_back_bitmap
end
alias galv_busts_window_dispose dispose
def dispose
galv_busts_window_dispose
dispose_bust
end
def dispose_bust
@bust.dispose if [url=mailto:
[email protected]
]
[email protected]
[/url]?
@bust.bitmap.dispose if [url=mailto:
[email protected]
]
[email protected]
[/url]?
end
alias galv_busts_window_update_back_sprite update_back_sprite
def update_back_sprite
galv_busts_window_update_back_sprite
update_bust if openness > 0
end
def update_bust
if !$game_message.bust_name.empty? && !$game_switches[Galv_Bust::DISABLE_SWITCH]
@bust.mirror = $game_message.mirror
@bust.bitmap = Cache.picture($game_message.bust_name + "-" + ($game_message.bust_index + 1).to_s)
if !$game_message.mirror
if Galv_Bust::SLIDE
@bust.x = ((openness.to_f / 255) * @bust.width) - @bust.width
else
@bust.x = 0
end
else
if Galv_Bust::SLIDE
@bust.x = Graphics.width - ((openness.to_f / 255) * @bust.width)
else
@bust.x = Graphics.width - @bust.bitmap.width
end
end
if $game_message.position == 2 && !Galv_Bust::BUST_Y_OVER
@bust.y = Graphics.height - @bust.bitmap.height - self.height
else
@bust.y = Graphics.height - @bust.bitmap.height
end
else
@bust.bitmap = nil
end
if $game_switches[Galv_Bust::DISABLE_SWITCH]
@bust.opacity = 0
else
@bust.opacity = openness
end
@bust.update
end
def new_line_x
if $game_switches[Galv_Bust::DISABLE_SWITCH]
$game_message.face_name.empty? ? 0 : 112
else
if @bust.z >= self.z && !$game_message.mirror && $game_message.position == 2
$game_message.face_name.empty? ? 0 : @bust.bitmap.width + Galv_Bust::TEXT_X
else
return 0
end
end
end
def draw_face(face_name, face_index, x, y, enabled = true)
return if !$game_message.face_name.empty? && !$game_switches[Galv_Bust::DISABLE_SWITCH]
super
end
end
复制代码
test.jpg
(144.53 KB, 下载次数: 32)
下载附件
保存到相册
2013-10-1 22:11 上传
作者:
喵呜喵5
时间:
2013-10-1 22:56
本帖最后由 喵呜喵5 于 2013-10-1 23:00 编辑
因为你不是用代码框所以麻烦你自己慢慢去找了……
图像处于画面下方:
“BUST_Y_OVER = false"这一句改成“BUST_Y_OVER = true"
图像处于右侧:
方法一:
使用一个左边空出一大块的半身像……
方法二:
先把半身像左右镜像,然后把
def initialize
galv_busts_message_initialize
@ mirror = false
end
复制代码
这一段改成
def initialize
galv_busts_message_initialize
@【防止论坛修改代码,请删除这个大括号及其中间的内容】mirror = true
end
复制代码
作者:
tsanggrace2002
时间:
2013-10-2 13:49
怪物的历史书我追實況看了!!非常精彩!沒想到是大神回應!!!感謝幫忙,問題己解決~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1