GALV_maptravel研究分析(1)
強大的地圖傳送式插件~~
我以自帶demo進行分析,本篇地圖Init setting map
?
?
?
1.----------------------------------
實例?創(chuàng)建地圖
Galv.MAPT.createMap(0,"map3",
[["bg1",0.4,0.6,255],["bg2",-0.5,-0.3,160]],
[["fg1",0.2,-0.2,60]]
);
語法
Galv.MAPT.createMap(id,"mapImage",[[bg],[bg]],[[fg],[fg]]);
INFO:
id = a unique number to identify the map you created? ?創(chuàng)建的地圖編號
"mapImage" = the name of the map graphic to use from /img/maptravel/? ? 背景圖名稱(注意路徑)
this image will determine the size of your map in the scene? ? 此圖片會影響你的地圖尺寸
[bg] = an array to set up a background graphic behind the map image? ? ?一個數(shù)組,用于在地圖圖像后面設置背景圖形
You can have as many bg arrays as desired each should have:? ?可以設置多個
["bgimage",xmove,ymove,opacity]
[fg] = works the same as bg arrays but instead for foreground images? ?原理與bg相同,但用于代替前景圖
["fgimage",xmove,ymove,opacity]
注意,這里是兩個大數(shù)組,內(nèi)包含小數(shù)組
?
+++++++++++++++++++++++++++++++++華麗分割線+++++++++++++++++++++++++++++++++++++++++++++++++++
2.-----------------------------------
實例
Galv.MAPT.setLocation(0,"Gov's Mansion","loc_mansion",490,160,1,8,11,"This is the Governor's Mansion|It's just a test map with no actual mansion here");
Galv.MAPT.setLocation(0,"Your Mansion","loc_mansion",620,440,3,8,11,"This is your 'mansion' but you lost the key!|You can't get in!");
Galv.MAPT.setLocation(0,"Campsite","loc_tent",1240,300,4,8,11,"I think it's a tent. It looks like a tent|Yeah it's a tent.",1);
語法
Galv.MAPT.setLocation(id,"name","image",mx,my,tmid,tx,ty,"desc",f);
INFO:
id = the unique number identifying the map you created above? ?上級地圖,上級地圖!的ID,或者說包含地圖
"name" = the name of the location (also used to reference it)
"image" = the name of the location graphic to use from /img/maptravel/? ? ?顯示在大地圖上的圖標
this graphic requires 3 rows in the spritesheet for:
top = normal, middle = active, bottom = disabled
mx = the x postion on your map graphic for the location
my = the y postion on your map graphic for the location
tmid = transfer map id - the in-game map id to transfer to? ? ? 跳轉(zhuǎn)目標地圖的ID
tx = the in-game map x co-ordinate to transfer to? ? ? ? ? ? ? ? ? ?跳轉(zhuǎn)后的的位置
ty = the in-game map y co-ordinate to transfer to
"desc" = a short description displayed when location is selected.? ?下方描述
Use the | symbol to specify a new line.
f = frames of animation in your location image. Don't include
this attribute to use the plugin setting default frames? ? 動畫針
Note that you can use this setLocation to overwrite a previously set one
using the same name if you want to change it to something else.
In addition to locations, you can add 'objects' that work in a similar
way but only have one row of graphics in the spritesheet and will not
appear in the location list.
?
+++++++++++++++++++++++++++++++++華麗分割線+++++++++++++++++++++++++++++++++++++++++++++++++++
3-----------------------------------
實例
Galv.MAPT.enableLocation(0,"Your Mansion",false);
語法
Galv.MAPT.enableLocation(id,"name",s); // s can be true or false to
// set the location "name" in the
// map id to enabled or disabled
轉(zhuǎn)載于:https://www.cnblogs.com/empist/p/10202324.html
總結(jié)
以上是生活随笔為你收集整理的GALV_maptravel研究分析(1)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: @codeforces - 1096G@
- 下一篇: Leetcode 187.重复的DNA序