Project1
标题:
我这显示 脚本 好卡帧 求高手优化 我很菜的
[打印本页]
作者:
z2z4
时间:
2013-8-24 20:33
标题:
我这显示 脚本 好卡帧 求高手优化 我很菜的
module Freya
Shangd = false #false true
end
$variables_id = 14
class Window_Shangd < Window_Base
#--------------------------------------------------------------------------
# ● 对象初始化
#--------------------------------------------------------------------------
def initialize
super(285,400,110,50)
self.opacity = 0
unless $game_system.s_dian
self.contents_opacity = 0
end
@variable = 0
refresh
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
if $game_system.s_dian
self.contents_opacity = 255
else
self.contents_opacity = 0
end
refresh
end
#--------------------------------------------------------------------------
# ● 设置地图上显示的变量 刷新 # 在图表与变量都有变化的情况下
#--------------------------------------------------------------------------
def refresh
if != $game_variables[$variables_id]
self.contents.clear
change_color(text_color(4)) #水晶
self.contents.draw_text(0,0,50,32,$game_variables[$variables_id].to_s,3)
#else
#change_color(text_color(2)) #水晶
#self.contents.draw_text(0,0,50,32,$game_variables[$variables_id].to_s,3)
@variable = $game_variables[$variables_id]
end
end
end
class Game_System
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :s_dian
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
alias vw_initialize initialize
def initialize
vw_initialize
@s_dian = Freya::Shangd
end
end
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# 地图画面
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
alias new_start start
def start
new_start
@Shangd_window = Window_Shangd.new
end
#--------------------------------------------------------------------------
# ● 刷新窗口
#--------------------------------------------------------------------------
alias new_update update
def update
new_update
@Shangd_window.refresh
end
#--------------------------------------------------------------------------
# ● 释放窗口
#--------------------------------------------------------------------------
alias new_terminate terminate
def terminate
new_terminate
@Shangd_window.dispose
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1