赞 | 289 |
VIP | 0 |
好人卡 | 0 |
积分 | 85 |
经验 | 0 |
最后登录 | 2019-7-14 |
在线时间 | 775 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 8498
- 在线时间
- 775 小时
- 注册时间
- 2017-11-10
- 帖子
- 1231
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
已经调用了
- def refresh
- self.contents.clear
- end
复制代码
但还是无法清除内容。
不知道是什么问题造成的。
请前辈帮忙看看该脚本出现了什么问题...
#============================================================================== # ■ module Angle_Message #------------------------------------------------------------------------------ module Angle_Message Window_X = 0 Window_Y = 360 Window_Width = 320 Window_Height = 120 Tips_Se ="Audio/SE/系统" Angle_Max = 4 Info_Text = "歡迎您進入遊戲!" $angle = 0 end #============================================================================== # ■ Window_Show_Message #------------------------------------------------------------------------------ # 信息窗口。 #============================================================================== class Window_Show_Message < Window_Selectable include Angle_Message #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(Window_X, Window_Y, Window_Width, Window_Height) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 refresh end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 #-------------------------------------------------------------------------- def set_text1(text) if text != "" # 再描绘文本 self.contents.clear self.contents.font.size = 16 self.contents.font.color = Color.new(-170,-170,-170,255) self.contents.draw_text(4, 0 + 1, self.width - 40, 32,text) self.contents.font.color = Color.new(255, 128, 128, 255) self.contents.draw_text(3, 0, self.width - 40, 32,text) @text = text end self.visible = true end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 #-------------------------------------------------------------------------- def set_text2(text) if text != "" # 再描绘文本 self.contents.clear self.contents.font.size = 16 self.contents.font.color = Color.new(-170,-170,-170,255) self.contents.draw_text(4, 20 + 1, self.width - 40, 32,text) self.contents.font.color = Color.new(255, 128, 128, 255) self.contents.draw_text(3, 20, self.width - 40, 32,text) @text = text end self.visible = true end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 #-------------------------------------------------------------------------- def set_text3(text) if text != "" # 再描绘文本 self.contents.clear self.contents.font.size = 16 self.contents.font.color = Color.new(-170,-170,-170,255) self.contents.draw_text(4, 40 + 1, self.width - 40, 32,text) self.contents.font.color = Color.new(255, 128, 128, 255) self.contents.draw_text(3, 40, self.width - 40, 32,text) @text = text end self.visible = true end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 #-------------------------------------------------------------------------- def set_text4(text) if @text != "" # 再描绘文本 self.contents.clear self.contents.font.size = 16 self.contents.font.color = Color.new(-170,-170,-170,255) self.contents.draw_text(4, 60 + 1, self.width - 40, 32,text) self.contents.font.color = Color.new(255, 128, 128, 255) self.contents.draw_text(3, 60, self.width - 40, 32,text) @text = text end self.visible = true end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear end end #============================================================================== # ■ Interpreter #------------------------------------------------------------------------------ # 执行事件命令的解释器。本类在 Game_System 类 # 与 Game_Event 类的内部使用。 #============================================================================== class Interpreter include Angle_Message #-------------------------------------------------------------------------- # ● set_line_text #-------------------------------------------------------------------------- def set_line_text @message2_window = Window_Show_Message.new if $angle == 0 @message2_window.set_text1($angle_message) end if $angle == 1 @message2_window.set_text2($angle_message) end if $angle == 2 @message2_window.set_text3($angle_message) end if $angle == 3 @message2_window.set_text4($angle_message) end if $angle > 3 $angle = 0 @message2_window.refresh @message2_window.set_text1($angle_message) end end #-------------------------------------------------------------------------- # ● 增减金钱 #-------------------------------------------------------------------------- def command_125 value = operate_value(@parameters[0], @parameters[1], @parameters[2]) $game_party.gain_gold(value) if value >= 0 $angle_message = "#{$game_party.actors[0].name}得到了#{value}#{$data_system.words.gold}" else $angle_message = "#{$game_party.actors[0].name}失去了#{value.abs.to_s}#{$data_system.words.gold}" end set_line_text $angle += 1 Audio.se_play(Tips_Se, 100, 100) return true end end #============================================================================== # ■ Scene_Map #------------------------------------------------------------------------------ # 处理地图画面的类。 #============================================================================== class Scene_Map include Angle_Message #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main @spriteset = Spriteset_Map.new @message_window = Window_Message.new Graphics.transition if $start $angle_message = Info_Text set_line_text $angle += 1 Audio.se_play(Tips_Se, 100, 100) $start = false end # 主循环 loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @spriteset.dispose @message_window.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # ● set_line_text #-------------------------------------------------------------------------- def set_line_text @message2_window = Window_Show_Message.new #if @message2_window == nil if $angle == 0 @message2_window.set_text1($angle_message) end if $angle == 1 @message2_window.set_text2($angle_message) end if $angle == 2 @message2_window.set_text3($angle_message) end if $angle == 3 @message2_window.set_text4($angle_message) end if $angle > 3 $angle = 0 @message2_window.refresh @message2_window.set_text1($angle_message) end end end
#==============================================================================
# ■ module Angle_Message
#------------------------------------------------------------------------------
module Angle_Message
Window_X = 0
Window_Y = 360
Window_Width = 320
Window_Height = 120
Tips_Se ="Audio/SE/系统"
Angle_Max = 4
Info_Text = "歡迎您進入遊戲!"
$angle = 0
end
#==============================================================================
# ■ Window_Show_Message
#------------------------------------------------------------------------------
# 信息窗口。
#==============================================================================
class Window_Show_Message < Window_Selectable
include Angle_Message
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(Window_X, Window_Y, Window_Width, Window_Height)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# ● 设置文本
# text : 窗口显示的字符串
#--------------------------------------------------------------------------
def set_text1(text)
if text != ""
# 再描绘文本
self.contents.clear
self.contents.font.size = 16
self.contents.font.color = Color.new(-170,-170,-170,255)
self.contents.draw_text(4, 0 + 1, self.width - 40, 32,text)
self.contents.font.color = Color.new(255, 128, 128, 255)
self.contents.draw_text(3, 0, self.width - 40, 32,text)
@text = text
end
self.visible = true
end
#--------------------------------------------------------------------------
# ● 设置文本
# text : 窗口显示的字符串
#--------------------------------------------------------------------------
def set_text2(text)
if text != ""
# 再描绘文本
self.contents.clear
self.contents.font.size = 16
self.contents.font.color = Color.new(-170,-170,-170,255)
self.contents.draw_text(4, 20 + 1, self.width - 40, 32,text)
self.contents.font.color = Color.new(255, 128, 128, 255)
self.contents.draw_text(3, 20, self.width - 40, 32,text)
@text = text
end
self.visible = true
end
#--------------------------------------------------------------------------
# ● 设置文本
# text : 窗口显示的字符串
#--------------------------------------------------------------------------
def set_text3(text)
if text != ""
# 再描绘文本
self.contents.clear
self.contents.font.size = 16
self.contents.font.color = Color.new(-170,-170,-170,255)
self.contents.draw_text(4, 40 + 1, self.width - 40, 32,text)
self.contents.font.color = Color.new(255, 128, 128, 255)
self.contents.draw_text(3, 40, self.width - 40, 32,text)
@text = text
end
self.visible = true
end
#--------------------------------------------------------------------------
# ● 设置文本
# text : 窗口显示的字符串
#--------------------------------------------------------------------------
def set_text4(text)
if @text != ""
# 再描绘文本
self.contents.clear
self.contents.font.size = 16
self.contents.font.color = Color.new(-170,-170,-170,255)
self.contents.draw_text(4, 60 + 1, self.width - 40, 32,text)
self.contents.font.color = Color.new(255, 128, 128, 255)
self.contents.draw_text(3, 60, self.width - 40, 32,text)
@text = text
end
self.visible = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
end
end
#==============================================================================
# ■ Interpreter
#------------------------------------------------------------------------------
# 执行事件命令的解释器。本类在 Game_System 类
# 与 Game_Event 类的内部使用。
#==============================================================================
class Interpreter
include Angle_Message
#--------------------------------------------------------------------------
# ● set_line_text
#--------------------------------------------------------------------------
def set_line_text
@message2_window = Window_Show_Message.new
if $angle == 0
@message2_window.set_text1($angle_message)
end
if $angle == 1
@message2_window.set_text2($angle_message)
end
if $angle == 2
@message2_window.set_text3($angle_message)
end
if $angle == 3
@message2_window.set_text4($angle_message)
end
if $angle > 3
$angle = 0
@message2_window.refresh
@message2_window.set_text1($angle_message)
end
end
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@parameters[0], @parameters[1], @parameters[2])
$game_party.gain_gold(value)
if value >= 0
$angle_message = "#{$game_party.actors[0].name}得到了#{value}#{$data_system.words.gold}"
else
$angle_message = "#{$game_party.actors[0].name}失去了#{value.abs.to_s}#{$data_system.words.gold}"
end
set_line_text
$angle += 1
Audio.se_play(Tips_Se, 100, 100)
return true
end
end
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# 处理地图画面的类。
#==============================================================================
class Scene_Map
include Angle_Message
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
Graphics.transition
if $start
$angle_message = Info_Text
set_line_text
$angle += 1
Audio.se_play(Tips_Se, 100, 100)
$start = false
end
# 主循环
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@message_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# ● set_line_text
#--------------------------------------------------------------------------
def set_line_text
@message2_window = Window_Show_Message.new #if @message2_window == nil
if $angle == 0
@message2_window.set_text1($angle_message)
end
if $angle == 1
@message2_window.set_text2($angle_message)
end
if $angle == 2
@message2_window.set_text3($angle_message)
end
if $angle == 3
@message2_window.set_text4($angle_message)
end
if $angle > 3
$angle = 0
@message2_window.refresh
@message2_window.set_text1($angle_message)
end
end
end
|
|