Project1
标题: 如何在角色面板中加一条经验槽 [打印本页]
作者: wuchangdao55 时间: 2012-10-22 15:29
标题: 如何在角色面板中加一条经验槽
如题!如何在角色面板中加一条经验槽~!!
要怎么做呢!!??
-
QQ截图20121022152849.jpg
(43.93 KB, 下载次数: 26)
作者: 铅笔描绘的思念 时间: 2012-10-22 15:42
本帖最后由 铅笔描绘的思念 于 2012-10-22 15:59 编辑
编辑以防误人子弟。。。
class Window_Base < Window
#追加:EXP颜色
def exp_gauge_color1; text_color(28); end; # EXP 值槽 1
def exp_gauge_color2; text_color(29); end; # EXP 值槽 2
#--------------------------------------------------------------------------
# ● 绘制 EXP
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, width = 120)
t1 = actor.next_level_exp - actor.current_level_exp - (actor.next_level_exp - actor.current_level_exp)
t2 = actor.next_level_exp - actor.current_level_exp
rate = 120 * t1 / t2
draw_gauge(x, y - 6, width, rate, exp_gauge_color1, exp_gauge_color2)
change_color(system_color)
draw_text(x, y, 30, line_height, "EXP")
draw_text(x + width - 99, y, 44, WLH, actor.exp, 2)
draw_text(x + width - 36, y, 11, WLH, "/", 2)
draw_text(x + width - 35, y, 44, WLH, actor.next_level_exp, 2)
end
end
class Game_Actor < Game_Battler
def exp_rate
(exp - current_level_exp) / (next_level_exp - current_level_exp)
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_exp(actor, rect.x + 20, rect.y + 1)
draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
end
end
class Window_Base < Window
#追加:EXP颜色
def exp_gauge_color1; text_color(28); end; # EXP 值槽 1
def exp_gauge_color2; text_color(29); end; # EXP 值槽 2
#--------------------------------------------------------------------------
# ● 绘制 EXP
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, width = 120)
t1 = actor.next_level_exp - actor.current_level_exp - (actor.next_level_exp - actor.current_level_exp)
t2 = actor.next_level_exp - actor.current_level_exp
rate = 120 * t1 / t2
draw_gauge(x, y - 6, width, rate, exp_gauge_color1, exp_gauge_color2)
change_color(system_color)
draw_text(x, y, 30, line_height, "EXP")
draw_text(x + width - 99, y, 44, WLH, actor.exp, 2)
draw_text(x + width - 36, y, 11, WLH, "/", 2)
draw_text(x + width - 35, y, 44, WLH, actor.next_level_exp, 2)
end
end
class Game_Actor < Game_Battler
def exp_rate
(exp - current_level_exp) / (next_level_exp - current_level_exp)
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_exp(actor, rect.x + 20, rect.y + 1)
draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
end
end
搞定坐标调一调
作者: wuchangdao55 时间: 2012-10-22 17:10
要放在哪里呢?
‘‘──wuchangdao55于2012-10-22 17:10补充以下内容:
要放在哪里呢》
’’
作者: fangqing9 时间: 2012-10-22 18:54
http://rpg.blue/thread-252003-1-1.html
可以用这个脚本整合,放在脚本页面的后面
作者: zlpwb1666 时间: 2012-10-23 15:01
LZ问一个问题哈
怎么才能在选项的前面放一个图标呢
作者: q854240045 时间: 2012-10-26 18:50
#==============================================================================
# F06 - 队伍状态窗口显示改造 - By芙蕾娅
#------------------------------------------------------------------------------
# ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
#==============================================================================
module Freya
ExpGaugeColor1 = Color.new(192,128,255)
ExpGaugeColor2 = Color.new(204,192,255)
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中所有窗口的父类
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 绘制等级
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
a = actor.next_level_exp - actor.current_level_exp
b = actor.next_level_exp - actor.exp
rate = 1 - (b.to_f / a)
draw_gauge(x, y, 96, rate,Freya::ExpGaugeColor1, Freya::ExpGaugeColor2)
change_color(system_color)
draw_text(x, y, 32, line_height, Vocab::level_a)
change_color(normal_color)
draw_text(x + 32, y, 24, line_height, actor.level, 2)
end
#--------------------------------------------------------------------------
# ● 绘制简单的状态
#--------------------------------------------------------------------------
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x, y)
draw_actor_level(actor, x, y + line_height * 1)
draw_actor_icons(actor, x - 107, y + line_height * 2 + 12)
draw_actor_class(actor, x + 120, y)
draw_actor_hp(actor, x + 120, y + line_height * 1)
draw_actor_mp(actor, x + 120, y + line_height * 2)
end
end
#==============================================================================
# F06 - 队伍状态窗口显示改造 - By芙蕾娅
#------------------------------------------------------------------------------
# ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
#==============================================================================
module Freya
ExpGaugeColor1 = Color.new(192,128,255)
ExpGaugeColor2 = Color.new(204,192,255)
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中所有窗口的父类
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 绘制等级
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
a = actor.next_level_exp - actor.current_level_exp
b = actor.next_level_exp - actor.exp
rate = 1 - (b.to_f / a)
draw_gauge(x, y, 96, rate,Freya::ExpGaugeColor1, Freya::ExpGaugeColor2)
change_color(system_color)
draw_text(x, y, 32, line_height, Vocab::level_a)
change_color(normal_color)
draw_text(x + 32, y, 24, line_height, actor.level, 2)
end
#--------------------------------------------------------------------------
# ● 绘制简单的状态
#--------------------------------------------------------------------------
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x, y)
draw_actor_level(actor, x, y + line_height * 1)
draw_actor_icons(actor, x - 107, y + line_height * 2 + 12)
draw_actor_class(actor, x + 120, y)
draw_actor_hp(actor, x + 120, y + line_height * 1)
draw_actor_mp(actor, x + 120, y + line_height * 2)
end
end
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |