[JavaScript] 纯文本查看 复制代码
partial class Window_Ditu_name extends Window_Base
{
var jilu_name:String;
var shijian_index:int;
var map_id:int;
var map: Map;
var map_name:String;
function Window_Ditu_name(map_id:int)
{
super(360,10,108,60);//x坐标,y坐标,窗口的宽度大小,窗口的高度大小
this.contents = new Js_Bitmap(this.width - 32,this.height - 32);
this.jilu_name = game._map.map_name;
this.shijian_index = 0;
this.map_id= map_id;
this.map = new Map();
refresh();
}
//刷新
function refresh()
{
this.contents.clear();
this.contents.font.color = normal_color();
this.map.Load_Data("Data/" + "Map" + map_id.ToString("0000") + ".json");
this.map_name = this.map.name;
var a:String = this.map_name;
var b:int = 0;
if(a.length>=3)
b = 0;
else
b= 20;
this.contents.draw_text(15+b, -2, 128, 32, this.map_name, 0);
}
function update(){
super();
if(this.jilu_name!=game._map.map_name)
{
this.jilu_name=game._map.map_name;
refresh();
}
if(this.visible)
{
this.shijian_index ++;
}
if(this.shijian_index >=10)//100是窗口的存在时间,60为1秒
this.visible = false;
}
}