[教程]关于AvgMakerDS 1.4正式版中按钮的应用简单说明



yuuhimesama
2009-12-02 18:44:31

话说现在有多少人在用1.4版呢。。。

[b]AMDS1.4正式版已放出,请配合1.4看本教程[/b]


目前的版本只支持128X32大小的图片按钮,分两种状态显示

需要准备一个128X64的图片素材。

如下图的图片,取名为 startbutton.png
[attach]1972[/attach]

图片的上半部分是按钮的挂起状态,即128X32
图片的下半部分是按钮的按下状态。即128X32


在使用的时候必须先把图片切割成两个64X64大小的图片,取名为XXX1和XXX2(XXX为你的图片按钮的文件名)

如下图的两张图片
[attach]1973[/attach] [attach]1974[/attach]
startbutton1.png startbutton2.png


然后转换。。。

----------------------------------------

然后打包。。。

[color=navy]如打包为button.res
[/color]
----------------------------------------

然后写代码。。。

这里引用TH2DS中的一段

[code=amds]
@LoadImageButton(0,avgFiles/chara/button.res, startbutton, 64, 27); //ID为0,资源读取自button.res中,坐标为(64,27)
@LoadImageButton(1,avgFiles/chara/button.res, loadbutton, 64, 59); //ID为1,资源读取自button.res中,坐标为(64,59)
@LoadImageButton(2,avgFiles/chara/button.res, specialbutton, 64, 123); //ID为2,资源读取自button.res中,坐标为(64,123)
@set_var(choice, -1); // 初始化一个变量并赋值为-1
@image_select(choice, 3); //注意此行!!! 加载按钮,并且加载3个
@if($(choice) == 0); //选择ID为0的按钮时候的操作
@res_playSFX(avgFiles/sound/sd.res,SE_9111.raw); //标题声音
@fadeout(2,1,2);
@delay(1000);
@btbg(null,0);
@bg(null,0);
@fadein(2,1,2); //初始化?
@changeText(avgFiles/data/010301000.spt);
@endif();
@if($(choice) == 1); //选择ID为1的按钮时候的操作
@res_playSFX(avgFiles/sound/sd.res,SE_9104.raw); //标题声音
@delay(500);
@load();
@jump(-14);
@endif();
@if($(choice) == 2); //选择ID为2的按钮时候的操作
@res_playSFX(avgFiles/sound/sd.res,SE_9104.raw);
@changeText(avgFiles/data/menu2.spt);
@endif();
@changeText(avgFiles/data/menu1.spt); //返回

[/code]


当你写出的代码不能运行的时候,请检查三个惊叹号的那行是否和这个一致。。。


by 双马尾优优姬


ywclgl258
2009-12-03 08:49:59

感谢分享~


白枫
2009-12-03 11:47:06

啊!我的眼睛~~


yuuhimesama
2009-12-03 12:38:37

[quote]啊!我的眼睛~~
[size=2][color=#999999]白枫 发表于 2009-12-3 11:47[/color] [url=http://www.yayabo.cn/redirect.php?goto=findpost&pid=4703&ptid=1436][img]http://www.yayabo.cn/images/common/back.gif[/img][/url][/size][/quote]
这是吐槽么。。。


dbcliu
2010-01-25 17:27:58

补充
转换时需要用的是另外的转换器 希望谢叔下次集成。


wcg12315
2010-02-08 23:01:08

看看,多谢指导了。


lw944920304
2010-03-06 13:21:33

学习了