Project1
标题:
法术栏帧数异常
[打印本页]
作者:
黑米馒头
时间:
2013-6-25 19:28
标题:
法术栏帧数异常
本帖最后由 黑米馒头 于 2013-6-25 21:03 编辑
法术栏一打开,游戏帧数马上从60多变成10几了,关了又恢复正常。。。来个高手帮忙看下怎么回事
#==============================================================================
# ■ Window_Skill
#------------------------------------------------------------------------------
# 特技画面、战斗画面、显示可以使用的特技浏览的窗口。
#==============================================================================
class Window_Skill_1 < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(153, 128, 370, 323)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
@column_max = 6
self.index = 0
self.opacity = 0
self.x = 142
self.y = 89
self.z = 112
# 战斗中的情况下将窗口移至中央并将其半透明化
if $game_temp.in_battle
self.x = 176
self.y = 107
self.height = 202
self.z = 112
self.back_opacity = 0
self.z = 9999
end
#--------------------------------------------------------------------------
# ● 描绘项目-宠物用
# index : 项目编号
#--------------------------------------------------------------------------
if $scene.is_a?(Scene_Baby)
@column_max = 1
def draw_item2(index)
if $stop == 0
return
end
skill = @data[index]
x = index % 6 * 42
y = (index / 6) * 42
rect = Rect.new(x, y, self.width / @column_max - 42, 42)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(-2,-2 , 42, 42))
if skill.element_set.include?(10)
end
end
#==============================================================================
@jnlan = Sprite.new
@jnlan.bitmap = Bitmap.new("Graphics/Pictures/图片显示/技能栏(宠物)")
@jnlan.y =3
@jnlan.x =3
# 图片的可视化,这样写可以让图片在原窗口可见和不可见时同步
def visible=(asd)
@jnlan.visible = asd if !$game_temp.in_battle # 不是战斗的情况才跟随
super(asd)
end
#==============================================================================
self.y = 85 #显示物品框的竖向移动
self.x = 329+3 #显示物品框的横向移动
self.width = 300 #显示物品框的宽
self.height = 200 #显示物品框的长
self.opacity = 0
@column_max = 6
end
if [url=home.php?mod=space&uid=95897]@actor[/url] != 0
refresh
end
end
#--------------------------------------------------------------------------
# ● 获取特技
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $scene.is_a?(Scene_Baby)
[url=home.php?mod=space&uid=95897]@actor[/url] = $baby_index
end
if $stop == 0
# self.contents.clear
return
end
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if $game_temp.in_battle
for i in
[email protected]
skill = $data_skills[@actor.skills[i]]
if skill != nil and skill.element_set.include?(10) == false
@data.push(skill)
end
end
else
for i in
[email protected]
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
end
# 如果项目数不是 0 就生成位图、重新描绘全部项目
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 42, row_max * 42)
for i in 0...@item_max
if $scene.is_a?(Scene_Baby) == false
draw_item(i)
else
draw_item2(i)
end
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = index % 6 * 42
y = (index / 6) * 42
rect = Rect.new(x, y, self.width - 42, 42)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(-2,-2 , 42, 42))
self.contents.font.size = 15
self.contents.font.color.set(255,255,255,255)
end
#--------------------------------------------------------------------------
# ● 刷新帮助文本
#--------------------------------------------------------------------------
def update_help
#@help_window.set_text(self.skill == nil ? "" : self.skill.description)
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
@help_window.set_text(skill)
#校正帮助窗口位置
@help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
end
end
复制代码
作者:
wwwcctvty
时间:
2013-6-25 20:07
36前应该少了二个“end”,50---71行表示看不明白,应该是放错位置了,51行生成的图好像也没有释放
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1