本帖最后由 小空弟 于 2013-8-21 08:03 编辑
彩色的RPG 发表于 2013-8-21 02:02
小鬼没有图标位置
能说的再明白一点吗?小鬼的图标是指武器图标还是make_cp的地方
for iii in $game_party.members + $game_troop.members @cppic[iii] = Sprite.new @cppic[iii].bitmap = @baseicons @cppic[iii].x = 4 @cppic[iii].y = 264 @cppic[iii].z = 510 @cppic[iii].zoom_x = 1.0 @cppic[iii].zoom_y = 1.0 @cppic[iii].opacity = 255 @cppic[iii].visible = $CP可见 end
for iii in $game_party.members + $game_troop.members
@cppic[iii] = Sprite.new
@cppic[iii].bitmap = @baseicons
@cppic[iii].x = 4
@cppic[iii].y = 264
@cppic[iii].z = 510
@cppic[iii].zoom_x = 1.0
@cppic[iii].zoom_y = 1.0
@cppic[iii].opacity = 255
@cppic[iii].visible = $CP可见
end
这个地方,@cppic里已经有很多数据了,想往里面再添加不能再重新从make_cp里面加,是不是得从refresh_cp里面?
我这样加的,感觉还是不对。求指教
def make_cp @blank_window = Window_Blank.new @cppic = {} @baseicons = Cache.system("Iconset") @cpshu = 0 for iii in $game_party.members + $game_troop.members @cppic[iii] = Sprite.new @cppic[iii].bitmap = @baseicons @cppic[iii].x = 4 @cppic[iii].y = 264 @cppic[iii].z = 510 @cppic[iii].zoom_x = 1.0 @cppic[iii].zoom_y = 1.0 @cppic[iii].opacity = 255 @cppic[iii].visible = $CP可见 @cpshu += 1 end @kaiguan = 0 @basepic = Sprite.new @basepic.bitmap = Bitmap.new(384, 8) @basepic.x = 16 @basepic.y = 272 @basepic.z = 500 @basepic.zoom_x = 1.0 @basepic.zoom_y = 1.0 @basepic.opacity = 255 @basepic.bitmap.fill_rect(0, 0, 384, 8, Color.new(0, 128, 192, 255)) @basepic.visible = $CP可见 refresh_cp end #-------------------------------------------------------------------------- # ● CP条更新 #-------------------------------------------------------------------------- def refresh_cp if @blank_window.disposed? return end @blank_window.x = 128 - @info_viewport.ox @basepic.x = 144 - @info_viewport.ox @baseicons = Cache.system("Iconset") for iii in $game_party.members + $game_troop.members if iii == @cpshu && @kaiguan == 0 @cppic[iii] = Sprite.new @cppic[iii].bitmap = @baseicons @cppic[iii].x = 4 @cppic[iii].y = 264 @cppic[iii].z = 510 @cppic[iii].zoom_x = 1.0 @cppic[iii].zoom_y = 1.0 @cppic[iii].opacity = 255 @cppic[iii].visible = $CP可见 @kaiguan = 1 end end for iii in $game_party.members + $game_troop.members if iii.is_a?(Game_Actor) if iii.weapon_id == 0 @cppic[iii].src_rect.set(96, 192, 24, 24) else icon_index = $data_weapons[iii.weapon_id].icon_index @cppic[iii].src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24) end else @cppic[iii].src_rect.set(312, 216, 24, 24) end if iii.hp > 0 @cppic[iii].visible = $CP可见 else @cppic[iii].visible = false end @cppic[iii].x = 132 + (iii.cp * 384 / 5000).to_i - @info_viewport.ox end end
def make_cp
@blank_window = Window_Blank.new
@cppic = {}
@baseicons = Cache.system("Iconset")
@cpshu = 0
for iii in $game_party.members + $game_troop.members
@cppic[iii] = Sprite.new
@cppic[iii].bitmap = @baseicons
@cppic[iii].x = 4
@cppic[iii].y = 264
@cppic[iii].z = 510
@cppic[iii].zoom_x = 1.0
@cppic[iii].zoom_y = 1.0
@cppic[iii].opacity = 255
@cppic[iii].visible = $CP可见
@cpshu += 1
end
@kaiguan = 0
@basepic = Sprite.new
@basepic.bitmap = Bitmap.new(384, 8)
@basepic.x = 16
@basepic.y = 272
@basepic.z = 500
@basepic.zoom_x = 1.0
@basepic.zoom_y = 1.0
@basepic.opacity = 255
@basepic.bitmap.fill_rect(0, 0, 384, 8, Color.new(0, 128, 192, 255))
@basepic.visible = $CP可见
refresh_cp
end
#--------------------------------------------------------------------------
# ● CP条更新
#--------------------------------------------------------------------------
def refresh_cp
if @blank_window.disposed?
return
end
@blank_window.x = 128 - @info_viewport.ox
@basepic.x = 144 - @info_viewport.ox
@baseicons = Cache.system("Iconset")
for iii in $game_party.members + $game_troop.members
if iii == @cpshu && @kaiguan == 0
@cppic[iii] = Sprite.new
@cppic[iii].bitmap = @baseicons
@cppic[iii].x = 4
@cppic[iii].y = 264
@cppic[iii].z = 510
@cppic[iii].zoom_x = 1.0
@cppic[iii].zoom_y = 1.0
@cppic[iii].opacity = 255
@cppic[iii].visible = $CP可见
@kaiguan = 1
end
end
for iii in $game_party.members + $game_troop.members
if iii.is_a?(Game_Actor)
if iii.weapon_id == 0
@cppic[iii].src_rect.set(96, 192, 24, 24)
else
icon_index = $data_weapons[iii.weapon_id].icon_index
@cppic[iii].src_rect.set(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
end
else
@cppic[iii].src_rect.set(312, 216, 24, 24)
end
if iii.hp > 0
@cppic[iii].visible = $CP可见
else
@cppic[iii].visible = false
end
@cppic[iii].x = 132 + (iii.cp * 384 / 5000).to_i - @info_viewport.ox
end
end
|