赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 505 |
最后登录 | 2015-12-21 |
在线时间 | 3 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 3 小时
- 注册时间
- 2008-7-10
- 帖子
- 15
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 牧歌 于 2009-11-8 14:03 编辑
饿.....托以前教程的福终于自己吧HP位置写好了 但是自己尝试添加了EXP的扩展 发现这貌似是我无法解决的了 所以特来寻求指点
如图一样 我知道是写错数据了 没办法 我没有相关的资料比对 所以在此寻求答案 顺便说下 等级的扩展怎么写呢 请各位大大也在指点一二 就像图二如此般
图二
以下是我用的脚本的剧本 请务必给与指点 要不偶本来就很没头绪了 会弄得更没头绪 看来在还没彻底理清脚本数据算法概念前依然迷茫.................
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
#........................................................................
self.windowskin = nil
@sta_back = []
@sta_output = []
@states_icons = []
@state_icon_p = []
@hp_bitmap = loadbitmap("Graphics/CP/hp.png")#// HP條
@mp_bitmap = loadbitmap("Graphics/CP/mp.png")#// MP條
@ap_bitmap = loadbitmap("Graphics/CP/AP.png")#// AP條
@exp_bitmap = loadbitmap("Graphics/CP/EXP.png")#// EXP條
for i in 0...$game_party.actors.size
actor = $game_party.actors
#//Background
@sta_back = Sprite.new
@sta_back.bitmap = loadbitmap("Graphics/CP/" +actor.name+"_平时.png")
@sta_back.x = 80 + i * 165
@sta_back.y = 320
@sta_back.z = self.z + 1
#//State
@states_icons = Sprite.new
@state_icon_p = 0
@states_icons.x = i * 165 + 180
@states_icons.y = 383
@states_icons.z = 999
st = $game_party.actors.states[@state_icon_p]
unless st.nil?
path = "Graphics/States/#{st}.png"
@states_icons.bitmap = loadbitmap(path)
end
#//Bars
@sta_output = Sprite.new
@sta_output.bitmap = Bitmap.new(150, 78)
@sta_output.x = 99 + i * 165
@sta_output.y = 480 - 105
@sta_output.z = self.z + 2
@sta_output.bitmap.font.name = "黑体"
end
@level_up_flags = [false, false, false, false]
#........................................................................
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
#......................................................................
actor_x = i * 155 + 5
@sta_output.bitmap.clear
hp_width = $game_party.actors.hp * @hp_bitmap.width/$game_party.actors.maxhp
mp_width = $game_party.actors.sp * @mp_bitmap.width/$game_party.actors.maxsp
ap_width = $game_party.actors.mp * @ap_bitmap.width/$game_party.actors.maxmp
exp_width = $game_party.actors.exp * @exp_bitmap.width/$game_party.actors.next_exp
hp_rect = Rect.new(0, 0, hp_width, 8)
mp_rect = Rect.new(0, 0, mp_width, 8)
ap_rect = Rect.new(0, 0, ap_width, 8)
exp_rect = Rect.new(0, 0, exp_width, 8)
@sta_output.bitmap.font.size = 12
@sta_output.bitmap.blt(81, 28, @hp_bitmap, hp_rect)
@sta_output.bitmap.blt(82, 39, @mp_bitmap, mp_rect)
@sta_output.bitmap.blt(87, 50, @ap_bitmap, ap_rect)
@sta_output.bitmap.blt(87, 63, @exp_bitmap, exp_rect)
@sta_output.bitmap.font.color.set(255, 255, 255,255)
@sta_output.bitmap.draw_text1(86, 25, 77, 11,$game_party.actors.hp.to_s + "/" + $game_party.actors.maxhp.to_s)
@sta_output.bitmap.draw_text1(86, 35, 77, 11,$game_party.actors.sp.to_s + "/" + $game_party.actors.maxsp.to_s)
@sta_output.bitmap.draw_text1(98, 46, 77, 11,$game_party.actors.mp.to_s + "/" + $game_party.actors.maxmp.to_s)
@sta_output.bitmap.draw_text1(98, 60, 77, 11,$game_party.actors.next_exp_s + "/" + $game_party.actors.next_exp.to_s)
#......................................................................
#......................................................................
if @level_up_flags
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 14
self.contents.draw_text1(actor_x+60, 58, 120, 32, "levelup")
end
end
end |
|