赞 | 5 |
VIP | 0 |
好人卡 | 2 |
积分 | 36 |
经验 | 24079 |
最后登录 | 2024-11-5 |
在线时间 | 1890 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3596
- 在线时间
- 1890 小时
- 注册时间
- 2010-6-19
- 帖子
- 1211
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
下面的脚本如何让地图名消失的时候,图片也一起消失,我加了个全局变量放着控制也没效果。。
class Window_Map_Name < Window_Base def initialize super(1024/2-180/2, 60, 180, 64) self.contents = Bitmap.new(width-32, height-32) @showing_time = 0 @text_color = Color.new(255,255,255,255) end def set_text(text, align = 2) if text != @text or align != @align self.contents.clear @showing_time = 100 @text = text @align = align @actor = nil self.contents_opacity = 255 x = 4 y = 0 self.contents.font.color = Color.new( 0, 0, 0, 192) self.contents.draw_text(x+2, y+2, self.width - 40, 32, "-"+text+"-",align=1) self.contents.font.color = Color.new( 64, 64, 64, 192) self.contents.draw_text(x-1, y-1, self.width - 40, 32, "-"+text+"-", align=1) self.contents.draw_text(x+1, y-1, self.width - 40, 32, "-"+text+"-", align=1) self.contents.draw_text(x-1, y+1, self.width - 40, 32, "-"+text+"-", align=1) self.contents.draw_text(x+1, y+1, self.width - 40, 32, "-"+text+"-", align=1) self.contents.font.color = @text_color self.contents.draw_text(x, y, self.width - 40, 32, "-"+text+"-", align=1) else @showing_time -= 1 if @showing_time < 100 self.contents_opacity = @showing_time * 100 elsif @showing_time <= 0 self.contents.clear $图片消失 = true end end self.visible = true end end class Scene_Map alias xrxs20_main main def main @map_name_window = Window_Map_Name.new @map_name_window.opacity = 0 # 生成地图名背景图 @map_picture = Sprite.new @map_picture.bitmap = Bitmap.new("Graphics/Pictures/Ui/主界面/地图名背景") if $图片消失 == true @map_picture.opacity = 100 else @map_picture.opacity = 0 end @map_picture.x = 1024/2-180/2 @map_picture.y = 77 @map_picture.z = 20 xrxs20_main @map_name_window.dispose # 释放地图名背景图 @map_picture.dispose @map_picture.bitmap.dispose end alias xrxs20_update update def update # 更新地图名 @map_name_window.set_text($game_map.name,1) xrxs20_update end end class Scene_Title alias xrxs20_main main def main $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end xrxs20_main end end class Game_Map def name $map_infos[@map_id] end end
class Window_Map_Name < Window_Base
def initialize
super(1024/2-180/2, 60, 180, 64)
self.contents = Bitmap.new(width-32, height-32)
@showing_time = 0
@text_color = Color.new(255,255,255,255)
end
def set_text(text, align = 2)
if text != @text or align != @align
self.contents.clear
@showing_time = 100
@text = text
@align = align
@actor = nil
self.contents_opacity = 255
x = 4
y = 0
self.contents.font.color = Color.new( 0, 0, 0, 192)
self.contents.draw_text(x+2, y+2, self.width - 40, 32, "-"+text+"-",align=1)
self.contents.font.color = Color.new( 64, 64, 64, 192)
self.contents.draw_text(x-1, y-1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.draw_text(x+1, y-1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.draw_text(x-1, y+1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.draw_text(x+1, y+1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.font.color = @text_color
self.contents.draw_text(x, y, self.width - 40, 32, "-"+text+"-", align=1)
else
@showing_time -= 1
if @showing_time < 100
self.contents_opacity = @showing_time * 100
elsif @showing_time <= 0
self.contents.clear
$图片消失 = true
end
end
self.visible = true
end
end
class Scene_Map
alias xrxs20_main main
def main
@map_name_window = Window_Map_Name.new
@map_name_window.opacity = 0
# 生成地图名背景图
@map_picture = Sprite.new
@map_picture.bitmap = Bitmap.new("Graphics/Pictures/Ui/主界面/地图名背景")
if $图片消失 == true
@map_picture.opacity = 100
else
@map_picture.opacity = 0
end
@map_picture.x = 1024/2-180/2
@map_picture.y = 77
@map_picture.z = 20
xrxs20_main
@map_name_window.dispose
# 释放地图名背景图
@map_picture.dispose
@map_picture.bitmap.dispose
end
alias xrxs20_update update
def update
# 更新地图名
@map_name_window.set_text($game_map.name,1)
xrxs20_update
end
end
class Scene_Title
alias xrxs20_main main
def main
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
xrxs20_main
end
end
class Game_Map
def name
$map_infos[@map_id]
end
end
|
|