将KAG3形式的按钮(graphic)修改为KAGEX形式(normal/over/on)
(1)在ButtonLayer.tjs内添加以下函数:
function loadButtons(normal,over,on)
{
//新建临时层用于读入图片
var temp=new global.Layer(window,this);
temp.loadImages(normal);
temp.setSizeToImageSize();
//新建一层用于取得normal/over/on
var graphic=new global.Layer(window,this);
//层的大小设置
graphic.width=temp.width*3;
graphic.height=temp.height;
//从临时层上拷贝图片
graphic.copyRect(0,0,temp,0,0,temp.width,temp.height);
temp.loadImages(over);
graphic.copyRect(temp.width,0,temp,0,0,temp.width,temp.height);
temp.loadImages(on);
graphic.copyRect(temp.width*2,0,temp,0,0,temp.width,temp.height);
// 画像を読み込む
super.assignImages(graphic);
super.width = imageWidth \ (Butt_showFocusImage ? 4 : 3);
super.height = imageHeight;
callOnPaint = true;
Butt_imageLoaded = true;
}
(2)在MessageLayer.tjs里修改addButton函数成如下:
function addButton(elm)
{
// グラフィカルボタンを配置
var object = new LinkButtonLayer(window, this);
//描绘按钮
if (elm.over==void) elm.over=elm.normal;
if (elm.on==void) elm.on=elm.over;
elm.graphic=elm.normal;
//object.loadImages(elm.graphic, elm.graphickey);
object.loadButtons(elm.normal,elm.over,elm.on);
object.linkNum = numLinks;
object.setPos(x, y);
//...以下略
}
function loadButtons(normal,over,on)
{
//新建临时层用于读入图片
var temp=new global.Layer(window,this);
temp.loadImages(normal);
temp.setSizeToImageSize();
//新建一层用于取得normal/over/on
var graphic=new global.Layer(window,this);
//层的大小设置
graphic.width=temp.width*3;
graphic.height=temp.height;
//从临时层上拷贝图片
graphic.copyRect(0,0,temp,0,0,temp.width,temp.height);
temp.loadImages(over);
graphic.copyRect(temp.width,0,temp,0,0,temp.width,temp.height);
temp.loadImages(on);
graphic.copyRect(temp.width*2,0,temp,0,0,temp.width,temp.height);
// 画像を読み込む
super.assignImages(graphic);
super.width = imageWidth \ (Butt_showFocusImage ? 4 : 3);
super.height = imageHeight;
callOnPaint = true;
Butt_imageLoaded = true;
}
(2)在MessageLayer.tjs里修改addButton函数成如下:
function addButton(elm)
{
// グラフィカルボタンを配置
var object = new LinkButtonLayer(window, this);
//描绘按钮
if (elm.over==void) elm.over=elm.normal;
if (elm.on==void) elm.on=elm.over;
elm.graphic=elm.normal;
//object.loadImages(elm.graphic, elm.graphickey);
object.loadButtons(elm.normal,elm.over,elm.on);
object.linkNum = numLinks;
object.setPos(x, y);
//...以下略
}