赞 | 5 |
VIP | 0 |
好人卡 | 0 |
积分 | 11 |
经验 | 11099 |
最后登录 | 2024-9-19 |
在线时间 | 324 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1090
- 在线时间
- 324 小时
- 注册时间
- 2017-1-24
- 帖子
- 122
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 戴迪 于 2017-8-5 03:18 编辑
不会的直接下载范例
#============================================================================== # ■地图显示HP/SP槽 + 金钱数量 # -by:戴迪 # -2017.6.17 # -本人首个脚本......大触轻喷 #------------------------------------------------------------------------------ #此脚本结构简单,可供比我还新的人学习- - #此脚本可自行更改HP/SP槽的大小,颜色,显示的坐标, #有能力的还可自行添加EXP,等级显示等 #HP/SP槽比较简易,本人在思考如何美化 #------------------------------------------------------------------------------ #使用方法: #1.在Main之前插入此脚本, # #2.在Scene_Map里,找到"●主处理下"的 # 生成信息窗口,添加 # @mapshow = Window_Mapshow.new # @mapshow.opacity = 60 #-------------------------------更改窗口透明度 # # 再往下滑,找到 # 释放信息窗口,添加 # @mapshow.dispose # # 再往下滑.....找到"●刷新画面"下的 #刷新信息窗口,添加 # @mapshow.update # # 完毕. # #============================================================================== # ■ Window_Mapshow #------------------------------------------------------------------------------ # 显示血条的窗口。 #============================================================================== class Window_Mapshow < Window_Base Hide_Window_Mapshow = 33 #-----控制窗口的开关为33号开关 #-------------------------------------------------------------------------- # ● 初始化窗口 #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 40 + 32) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ● 描绘HP槽 #-------------------------------------------------------------------------- def draw_actor_hp_bar(actor, x, y,width = 200) self.contents.fill_rect(36,4,width + 4,24,Color.new(255,255,255,255)) self.contents.fill_rect(36 + 2,4 + 2,width ,20,Color.new(0,0,0,255)) w1 = (1.0 * $game_party.actors[0].hp / $game_party.actors[0].maxhp) * width self.contents.fill_rect(36 + 2,4 + 2,w1 ,20,Color.new(200,0,0,255)) end #-------------------------------------------------------------------------- # ● 描绘SP槽 #-------------------------------------------------------------------------- def draw_actor_sp_bar(actor, x, y,width = 200) self.contents.fill_rect(36 + 240 ,4,width + 4,24,Color.new(255,255,255,255)) self.contents.fill_rect(36 + 2 + 240 ,4 + 2,width ,20,Color.new(0,0,0,255)) w2 = (1.0 * $game_party.actors[0].sp / $game_party.actors[0].maxsp) * width self.contents.fill_rect(36 + 2 + 240,4 + 2,w2 ,20,Color.new(248,112,0,255)) end #-------------------------------------------------------------------------- # ● 描绘金钱数目 #-------------------------------------------------------------------------- def draw_actor_gold(actor, x, y,width = 200) cx = contents.text_size($data_system.words.gold).width #cx = 11 self.contents.font.color = normal_color self.contents.draw_text(538, 0, 64-cx-2 ,32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(600-cx, 0, cx, 32, $data_system.words.gold, 2) end #-------------------------------------------------------------------------- # ● 刷新--通常在这绘制位图 #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_hp_bar($game_party.actors[0], 0, 20) draw_actor_sp_bar($game_party.actors[0], 0, 20) draw_actor_gold($game_party.gold.to_s, 0, 20) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(0,0 , 36, 32, "HP:") self.contents.draw_text(70,0 , 36, 32,$game_party.actors[0].hp.to_s) self.contents.draw_text(70 + 63,0 + 1, 36, 32, "/") self.contents.draw_text(70 + 63 + 42,0 + 1, 36, 32,$game_party.actors[0].maxhp.to_s) self.contents.draw_text(0 + 240,0 , 36, 32, "SP:") self.contents.draw_text(70 + 240,0 , 36, 32,$game_party.actors[0].sp.to_s) self.contents.draw_text(70 + 63 + 240,0 + 1, 36, 32, "/") self.contents.draw_text(70 + 105 + 240,0 + 1, 36, 32,$game_party.actors[0].maxsp.to_s) end def update super self.visible = !$game_switches[Hide_Window_Mapshow] return unless self.visible #-----unless相当于if not rest_hp = $game_party.actors[0].hp max_hp = $game_party.actors[0].maxhp rest_sp = $game_party.actors[0].sp max_sp = $game_party.actors[0].maxsp gold = $game_party.gold if $l7_old_hp != rest_hp || ($l7_old_maxhp != max_hp) || $l7_old_sp != rest_sp || ($l7_old_maxsp != max_sp) || $l7_old_gold != gold $l7_old_hp = rest_hp $l7_old_maxhp = max_hp $l7_old_sp = rest_sp $l7_old_maxsp = max_sp refresh end end end
#==============================================================================
# ■地图显示HP/SP槽 + 金钱数量
# -by:戴迪
# -2017.6.17
# -本人首个脚本......大触轻喷
#------------------------------------------------------------------------------
#此脚本结构简单,可供比我还新的人学习- -
#此脚本可自行更改HP/SP槽的大小,颜色,显示的坐标,
#有能力的还可自行添加EXP,等级显示等
#HP/SP槽比较简易,本人在思考如何美化
#------------------------------------------------------------------------------
#使用方法:
#1.在Main之前插入此脚本,
#
#2.在Scene_Map里,找到"●主处理下"的 # 生成信息窗口,添加
# @mapshow = Window_Mapshow.new
# @mapshow.opacity = 60 #-------------------------------更改窗口透明度
#
# 再往下滑,找到 # 释放信息窗口,添加
# @mapshow.dispose
#
# 再往下滑.....找到"●刷新画面"下的 #刷新信息窗口,添加
# @mapshow.update
#
# 完毕.
#
#==============================================================================
# ■ Window_Mapshow
#------------------------------------------------------------------------------
# 显示血条的窗口。
#==============================================================================
class Window_Mapshow < Window_Base
Hide_Window_Mapshow = 33 #-----控制窗口的开关为33号开关
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 40 + 32)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# ● 描绘HP槽
#--------------------------------------------------------------------------
def draw_actor_hp_bar(actor, x, y,width = 200)
self.contents.fill_rect(36,4,width + 4,24,Color.new(255,255,255,255))
self.contents.fill_rect(36 + 2,4 + 2,width ,20,Color.new(0,0,0,255))
w1 = (1.0 * $game_party.actors[0].hp / $game_party.actors[0].maxhp) * width
self.contents.fill_rect(36 + 2,4 + 2,w1 ,20,Color.new(200,0,0,255))
end
#--------------------------------------------------------------------------
# ● 描绘SP槽
#--------------------------------------------------------------------------
def draw_actor_sp_bar(actor, x, y,width = 200)
self.contents.fill_rect(36 + 240 ,4,width + 4,24,Color.new(255,255,255,255))
self.contents.fill_rect(36 + 2 + 240 ,4 + 2,width ,20,Color.new(0,0,0,255))
w2 = (1.0 * $game_party.actors[0].sp / $game_party.actors[0].maxsp) * width
self.contents.fill_rect(36 + 2 + 240,4 + 2,w2 ,20,Color.new(248,112,0,255))
end
#--------------------------------------------------------------------------
# ● 描绘金钱数目
#--------------------------------------------------------------------------
def draw_actor_gold(actor, x, y,width = 200)
cx = contents.text_size($data_system.words.gold).width #cx = 11
self.contents.font.color = normal_color
self.contents.draw_text(538, 0, 64-cx-2 ,32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(600-cx, 0, cx, 32, $data_system.words.gold, 2)
end
#--------------------------------------------------------------------------
# ● 刷新--通常在这绘制位图
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_hp_bar($game_party.actors[0], 0, 20)
draw_actor_sp_bar($game_party.actors[0], 0, 20)
draw_actor_gold($game_party.gold.to_s, 0, 20)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(0,0 , 36, 32, "HP:")
self.contents.draw_text(70,0 , 36, 32,$game_party.actors[0].hp.to_s)
self.contents.draw_text(70 + 63,0 + 1, 36, 32, "/")
self.contents.draw_text(70 + 63 + 42,0 + 1, 36, 32,$game_party.actors[0].maxhp.to_s)
self.contents.draw_text(0 + 240,0 , 36, 32, "SP:")
self.contents.draw_text(70 + 240,0 , 36, 32,$game_party.actors[0].sp.to_s)
self.contents.draw_text(70 + 63 + 240,0 + 1, 36, 32, "/")
self.contents.draw_text(70 + 105 + 240,0 + 1, 36, 32,$game_party.actors[0].maxsp.to_s)
end
def update
super
self.visible = !$game_switches[Hide_Window_Mapshow]
return unless self.visible #-----unless相当于if not
rest_hp = $game_party.actors[0].hp
max_hp = $game_party.actors[0].maxhp
rest_sp = $game_party.actors[0].sp
max_sp = $game_party.actors[0].maxsp
gold = $game_party.gold
if $l7_old_hp != rest_hp || ($l7_old_maxhp != max_hp) || $l7_old_sp != rest_sp || ($l7_old_maxsp != max_sp) || $l7_old_gold != gold
$l7_old_hp = rest_hp
$l7_old_maxhp = max_hp
$l7_old_sp = rest_sp
$l7_old_maxsp = max_sp
refresh
end
end
end
# 生成信息窗口----------------------------------在此处添加窗口 @message_window = Window_Message.new @mapshow = Window_Mapshow.new @mapshow.opacity = 20 #------------------------更改窗口透明度
# 生成信息窗口----------------------------------在此处添加窗口
@message_window = Window_Message.new
@mapshow = Window_Mapshow.new
@mapshow.opacity = 20 #------------------------更改窗口透明度
# 释放信息窗口--------------------------------记得在此处释放窗口 @message_window.dispose @mapshow.dispose
# 释放信息窗口--------------------------------记得在此处释放窗口
@message_window.dispose
@mapshow.dispose
# 刷新信息窗口----------------------------记得在此处刷新窗口 @message_window.update @mapshow.update
# 刷新信息窗口----------------------------记得在此处刷新窗口
@message_window.update
@mapshow.update
截图
地图显示HP SP 条.rar
(192.2 KB, 下载次数: 274)
|
评分
-
查看全部评分
|