




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、常見Lingo指令介紹一、控制Sprite的常見指令.指令名稱:sprite member指令語法:the member of sprite指令說明:sprite所代表的cast membero例:精靈替換set the member of sprite 1 to yuan可改為:Sprite(1).member=yuan”點(diǎn)句表示法:ObjectName.Property|function|Chunk that you want to specity.指令名稱:sprite memberNum指令語法:the memberNum of sprite指令說明:sprite所代表的cast me
2、mber所在的位置。例:循環(huán)播放on exitFrame meif sprite (1). memberNum =10 thensprite (1). memberNum = 1elsesprite (1) .memberNum二sprite( 1).memberNum+1end ifgo to the frameend3.旋轉(zhuǎn)、傾斜、翻轉(zhuǎn)精靈指令說明:這些變換可以應(yīng)用于位圖、文本、矢量圖形、GIF及Flash,但不能用于域,以 及工具面板上的橢圓和矩形。旋轉(zhuǎn):正值代表順時(shí)針,負(fù)值代表逆時(shí)針sprite(1).rotation=30set the rotation of sprite 1 to
3、 30例:指針調(diào)節(jié)sprite (1). rotation=sprite(1). rotation+5傾斜:正值向右傾斜,負(fù)值向左傾斜,正常狀態(tài)為0sprite(1).skew=10set the skew of sprite 1 to 10例:圖形變形sprite (1). skew=sprite(1). skew+10翻轉(zhuǎn):左右(水平)翻轉(zhuǎn)flipH,上下(垂直)翻轉(zhuǎn)flipV,設(shè)置值為TRUE或FALSE(1 或 0)sprite(1).flipH=TUREsprite(1).flipV=1例:翻轉(zhuǎn)與恢復(fù)指令名稱:blend指令說明:相當(dāng)于sprite在stage上的透明度,值可從0到1
4、00,數(shù)值越小透明度越高。Sprite(1).blend=50Set the blend of sprite 1 to 50例:圖像漸淡sprite (1). blend=50指令名稱:loc、locH、locV指令說明:the loc of sprite: sprite 當(dāng)前的位置,相當(dāng)于 point(the loch, the locV)the locH of sprite:水平位置the locV of sprit e:垂直位置sprite(1).loc=point(320,240)pointsprite(1).locH=320數(shù)值sprite(1).locV=240數(shù)值例:設(shè)置精靈位置
5、sprite (1). loc=point(320, 240)locZ指令說明:sprite目前在Z軸上的高度。Channels之間存在高低與前后的關(guān)系,channel小的 sprite 位于下層,channel大的sprite 位于上層。例:點(diǎn)擊相應(yīng)圖片移到最上層。on startMovieglobal highestCardhighestCard=5endon mouseUpglobal highestCardhighestCard二highestCard+1sprite (the clickOn). locZ=highestCardendTop、bottom Left、right指令說明
6、:環(huán)繞sprite長(zhǎng)方形的上下左右坐標(biāo)。on mouseUp meput sprite(1). topput sprite (1). bottomput sprite (1). leftput sprite (1). rightend用massage窗口查看。例:文字上下或左右反復(fù)運(yùn)動(dòng)。Put Sprite(1).rect例:匹配題intersects的應(yīng)用8.指令名稱:trails指令說明:在stage上留下殘影sprite(1).trails=trueupdatestage更新畫面,常用于顯示連續(xù)的動(dòng)作例:拖尾移動(dòng)on mouseUp mesprite(1). trails=truerep
7、eat with x=1 to 100sprite (1). locH=sprite(1). locH+2updatestageend repeatendforeColor、backColor控制演員前景色、背景色的屬性。注意:這個(gè)屬性主要用于用“tools palette”工具畫出的Shape (向量)圖形例:鼠標(biāo)點(diǎn)擊循環(huán)改變精靈的前景(背景)色on mouseUp mesprite(1). foreColor=sprite(1). foreColor-1 endconstraint指令說明:將某一可移動(dòng)的sprite的中心點(diǎn)的活動(dòng)范圍限制在另一個(gè)sprite的四 周邊框內(nèi)。on start
8、Moviesprite (1). constraint=2 - 2代表sprite (2)visible指令說明:sprite在stage上可見或隱藏。一個(gè)隱藏的sprite仍具有位置、尺 寸等各種屬性,只是視覺上看不見而已。Sprite(1).visible=falsepuppetSprite判斷某一 sprite是否處于puppet狀態(tài),是時(shí),其屬性與行為將由Lingo控制,否則依據(jù)score window中的設(shè)置。例:將sprite 1設(shè)置為puppet狀態(tài)。On prepateMoviepuppetSprite 1, trueendquad控制sprite的四個(gè)頂點(diǎn),用數(shù)組的方式來存放
9、四個(gè)點(diǎn)的坐標(biāo)值,依序分別為左上、右上、右 下、左下,改變四個(gè)點(diǎn)的坐標(biāo),可以改變sprite的圖框形狀on mouseUp meput sprite (1). quadput sprite (1). quad1put sprite (1). quad2put sprite (1). quad3put sprite(1). quad4endsprite(1).quad=point(9.0000,10.0000), point(309.0000, 10.0000), point(309.0000, 210.0000), point(9.0000, 210.0000)sprite(1).quad1=
10、point(9.0000,10.0000)數(shù)組在Lingo里就叫做列表,列表可以存儲(chǔ)一系列連續(xù)的數(shù)據(jù),如果數(shù)據(jù)具有相似性、規(guī)律 性,需要放到一起就可以使用列表來表示。二、鼠標(biāo)(Mouse)控制的常見指令1 .指令名稱:clickOn指令語法:the clickOn指令說明:判斷鼠標(biāo)最近一次點(diǎn)選過的sprite。返回最近一次單擊精靈通道的通道號(hào),如果 在舞臺(tái)上單擊則返回值為0。注意:只有附帶程序(寫在cast或sprite里面均可)的sprite才會(huì)被判斷,即使這個(gè)程序毫 無作用也無妨,例如:on mouseDown-end例:(1) beep次數(shù)控制on mouseUprepeat with
11、x=1 to the clickOnbeepend repeatend設(shè)置不帶程序spritemessage 窗口觀察 clickonon mouseDownput the clickonend2.指令名稱:mouseH、mouseV指令語法:the mouseH、the mouseV指令說明:當(dāng)前鼠標(biāo)點(diǎn)(cursor)的水平位置(the mouseH)與垂直位置(the mouseV)。例:判斷鼠標(biāo)接近spriteon exitFrame medH=the mouseH-sprite(1). locHdV=the mouseV-sprite(1). locVif dH*dH+dV*dV2*6
12、0 thenalert Too Slow!end ifendtickmouseWithin指令語法:on mouseWithin指令說明:判斷鼠標(biāo)點(diǎn)是否位于某個(gè)sprite區(qū)域之內(nèi)。如果這個(gè)sprite是bitmap 圖形,且其ink effect是matte,則他的區(qū)域?yàn)閳D形本身,否則為環(huán)繞其的長(zhǎng)方 形。例:鼠標(biāo)在某物體上停留時(shí)間過長(zhǎng)的警告。on mouseEnter mestartTimerendon mouseWithinif the timer120 thenalert Hey, youve been here too long!end ifendmouseUp、 mouseDown指
13、令語法: on mouseUp、on mouseDown指令說明:這是Ling。中最常用的指令。mouseUp常用在Button里面,使用者須先 按下再放開鼠標(biāo)的按鍵時(shí),程序才會(huì)被執(zhí)行,萬一用戶按錯(cuò)的話,可以將光標(biāo)移 出Button區(qū)域,則程序不會(huì)被執(zhí)行,可以減少出錯(cuò)的機(jī)率。mouseDown常被用在 拖拉對(duì)象、或某些講求快速判斷的指令之中。例一:on mouseUpbeepend例二:鼠標(biāo)按住某一對(duì)象時(shí),此對(duì)象隨光標(biāo)移動(dòng)。on mouseDown merepeat while the mouseDownsprite (1). loc= the mouseLocupdatestageend r
14、epeatendrightMouseUp、 rightMouseDown指令語法: on rightMouseUp、on rightMouseDown指令說明:針對(duì)鼠標(biāo)右鍵,用法基本與mouseUp和mouseDown相同。例:?jiǎn)螕羰髽?biāo)右鍵,彈出菜單on startmoviesprite (1). visible=0end startmovieon rightMousedownsprite (1). loc=the mouselocsprite(1). visible=1sprite(1). LocZ=1000end關(guān)于動(dòng)態(tài)鼠標(biāo)的設(shè)置8位三、鍵盤(Key)控制的常用指令key指令語法:the
15、key指令說明:鍵盤上最近一次被按過的鍵例:on keyDowncase the key ofj:sprite(1). locH=sprite(1). locH-5k:sprite(1). locH=sprite(1). locH+5o:alert 再見!quitend caseend注:Quit退出函數(shù)keycode指令語法:the keycode指令說明:鍵盤上最近一次被按過的鍵所對(duì)應(yīng)的號(hào)碼。想知道每個(gè)鍵所對(duì)應(yīng)的號(hào) 碼,可以:on keyDownput the keycodeend keyDown注意:在massag e窗口中觀看,電影窗口要激活例:控制木偶行走。KeyDown、 keyU
16、p指令語法:on KeyDown、on KeyUp指令說明:這兩個(gè)handlers通常用movie script,或可編輯修改的Texts Field Cast member Script或sprite script 里,對(duì)于 bitmap cast script,因?yàn)橹唤邮?與mouse相關(guān)的events,所以on KeyDown或on KeyUp都不會(huì)有任何作用。四、時(shí)間(time )控制的常用指令date()、time()(system clock)指令語法:the date、the long date、the short datethe time、the long time、the s
17、hort time例:顯示當(dāng)前的日期與時(shí)間on startmovieput the date into field dateput the long time into field timeendticks指令語法:the ticks指令說明:1秒=60 ticks, the ticks是將當(dāng)前計(jì)算機(jī)從開機(jī)到目前的時(shí)間用 ticks來顯示。startTimer指令說明:將所有關(guān)于用ticks計(jì)算時(shí)間的事件重新歸零。timer指令語法:the timer指令說明:檢測(cè)從startTimer后,當(dāng)前的時(shí)間為多少個(gè)ticks。五、文本控制的常用指令文本包括普通文本(text)、域文本(fields
18、)和字符串(strings)。設(shè)置名為Short speech的文本的第三段文字顏色為紅色。member(Short speech).paragraph3.color = rgb(255, 0, 0)rgb (red, green, blue)隨機(jī)變化的顏色on exitFrame merepeat with i=1 to 8member(text).chari.forecolor=random(255)end repeatend超鏈接文本on hyperlinkClicked me,datagotoNetpage(data)end-首先在text Inspector中輸入網(wǎng)址再加入這個(gè)精靈腳本-不想要下劃線可以在 property Inspector 里去掉 use hypertext stytleGo to movie(data)關(guān)于字體下載 HYPERLINK /enfont/ /enfont/字體設(shè)置字體演員轉(zhuǎn)換成圖片文本變圖片,導(dǎo)入字體演員3D文字六、控制圖片、動(dòng)畫與視頻常用指令1 .遮罩效果mask圖片的mask視頻的maskon startMovieset the mask of member qtmask to member mask end startMoviemember”abd.mask二me
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 學(xué)習(xí)動(dòng)力激發(fā)輔導(dǎo)考核試卷
- 舊貨零售店鋪選址與商圈分析考核試卷
- 拉丁語基礎(chǔ)與古羅馬文化考核試卷
- 智能材料設(shè)計(jì)與制造考核試卷
- 小學(xué)生經(jīng)典誦讀愛國課件
- 智能餐飲顧客服務(wù)系統(tǒng)考核試卷
- ehs之家安全培訓(xùn)課件
- 施工安全合同范本
- 城管部門采購合同范本
- 貨物拉運(yùn)合同范本
- 《瘋狂動(dòng)物城》全本臺(tái)詞中英文對(duì)照
- 建筑施工安全管理及揚(yáng)塵治理檢查投標(biāo)方案(技術(shù)方案)
- 六年級(jí)毛筆書法教案(下冊(cè))
- 秘魯農(nóng)村公路
- 五年級(jí)下冊(cè)勞動(dòng)全冊(cè)教案人教版貴州人民出版社
- 吉利質(zhì)量協(xié)議
- 空調(diào)系統(tǒng)的應(yīng)急預(yù)案
- 2023玻纖增強(qiáng)聚氨酯門窗工程技術(shù)規(guī)程
- 急性化膿性中耳炎課件
- 食堂食品安全隱患排查報(bào)告
- 汽車維修廠車輛進(jìn)出廠登記制度
評(píng)論
0/150
提交評(píng)論