求助.!关于标题做法.



『兔寳貝』
2010-08-23 16:11:08

[i=s] 本帖最后由 『兔寳貝』 于 2010-8-23 16:20 编辑 [/i]


那啥.标题画面的做法始终不明.
然后bbs发给我的这个..

function discolortitle(icon,newgame1,loadgame1,cgmode1,newgame2,loadgame2,cgmode2,dx,dy,stepx,stepy)
if _discolortitle==nil then

_discolortitle = {}
_discolortitle.blue = {}
_discolortitle.pink = {}
_discolortitle.blue[1] = LoadImage(newgame1,8888)
_discolortitle.blue[2] = LoadImage(loadgame1,8888)
_discolortitle.blue[3] = LoadImage(cgmode1,8888)
_discolortitle.pink[1] = LoadImage(newgame2,8888)
_discolortitle.pink[2] = LoadImage(loadgame2,8888)
_discolortitle.pink[3] = LoadImage(cgmode2,8888)
_discolortitle.icon = LoadImage(icon,8888)
_discolortitle.icondx = dx-2
_discolortitle.icondy = dy-2
_discolortitle.mode = 1
_discolortitle.chose = 1

elseif _discolortitle.mode==1 then

if KeyDown(KEY_UP)==1 then
_discolortitle.icondx = _discolortitle.icondx - stepx
_discolortitle.icondy = _discolortitle.icondy - stepy
_discolortitle.chose = _discolortitle.chose - 1
if _discolortitle.chose < 1 then
_discolortitle.chose = 3
_discolortitle.icondx = dx + stepx * 2
_discolortitle.icondy = dy + stepy * 2
end
end
if KeyDown(KEY_DOWN)==1 then
_discolortitle.icondx = _discolortitle.icondx + stepx
_discolortitle.icondy = _discolortitle.icondy + stepy
_discolortitle.chose = _discolortitle.chose + 1
if _discolortitle.chose > 3 then
_discolortitle.chose = 1
_discolortitle.icondx = dx
_discolortitle.icondy = dy
end
end
if KeyDown(KEY_CIRCLE)==1 then
_discolortitle.mode = 2
end

local _dx = dx
local _dy = dy

for i=1,3 do
if _discolortitle.chose==i then
ImageToScene(_discolortitle.pink[i],_dx,_dy)
else
ImageToScene(_discolortitle.blue[i],_dx,_dy)
end
_dx = _dx + stepx
_dy = _dy + stepy
end

elseif _discolortitle.mode==2 then
local chose = _discolortitle.chose
FreeImage(_discolortitle.blue[1])
FreeImage(_discolortitle.blue[2])
FreeImage(_discolortitle.blue[3])
FreeImage(_discolortitle.pink[1])
FreeImage(_discolortitle.pink[2])
FreeImage(_discolortitle.pink[3])
FreeImage(_discolortitle.icon)
_discolortitle = nil
return chose
end
loop()
end























discolortitle(icon,newgame1,loadgame1,cgmode1,,newgame2,loadgame2,cgmode2,,dx,dy,stepx,stepy);

icon:光标文件
newgame1:第一选项1
loadgame1:第二选项1
cgmode1:第三选项1
newgame2:第一选项2
loadgame2:第二选项2
cgmode2:第三选项2
dx:显示坐标x
dy:显示坐标y
stepx:间隔x
stepy:间隔y


chose = discolortitle("icon.png","start1.png","loadgame1.png","cg1.png","start2.png","loadgame2.png","cg2.png",0,0,0,25);
if chose==1 then goto(*newgame) end;
if chsoe==2 then goto(*loadgame) end;
if chose==3 then goto(*cgmode) end ;



看不明...有哪位可以教教我.
或者给个简明一点的代码我...


fanhuai
2010-08-23 16:36:39

[i=s] 本帖最后由 fanhuai 于 2010-8-23 16:42 编辑 [/i]

*title_select
chose = discolortitle("icon.png","start1.png","load1.png","exit1.png","extra1.png","start2.png","load2.png","exit2.png","extra2.png",0,0,0,0);


if chose==1 then goto(*XXXX) end;
if chose==2 then goto(*XXXX) end;
if chose==3 then goto(*XXXX); end
if chose==4 then goto(*XXXX) end ;

乃照着这样写,乃用三个就写三个,四个就照着这样写,不过三个以上,乃的上面的函数要添加内容了


ma8742044
2010-08-23 16:43:42

[i=s] 本帖最后由 ma8742044 于 2010-8-23 16:46 编辑 [/i]

我也借着贴子问个问题~~

滑竿光标触碰指定区域切换该区域图标代码要怎么写~


werhsqgl
2010-08-23 17:44:02

犯坏叔V5不解释。偶居然也看懂了。。。。。


k8u
2010-08-23 19:05:18

某大大说过,标题要长~~~~


yyeg
2010-08-23 19:29:37

乃们真蛋疼 尤其是兔子 (直接在群里说不就得了。非要来这里水)


ttdasd123
2010-08-23 19:41:32

[i=s] 本帖最后由 ttdasd123 于 2010-8-23 19:43 编辑 [/i]

[b]不放标题直接进游戏的路过~[/b]


love_xiaolu
2010-09-02 19:12:15

甘井子就是用这个做的标题,快去下载………


a813329653
2010-09-05 17:33:05

来学习的