国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 媒體動畫 > 正文

Director實例剖析:Lingo運用之repeat while

2024-09-08 19:27:03
字體:
來源:轉載
供稿:網友
lingo應用之repeat while
    repeat while (條件式循環)


播放,以上示例,需下載此插件。 點擊下載插件

語法:

repeat while 條件式

命令句 1
命令句 2
命令句 3
...

end repeat

說明:

反復執行 repeat while 及 end repeat 間的命令行,直到條件式的值為真時退出循環

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

the rect of sprite (矩形值)

語法:
the rect of sprite spritenumber

說明:
存取 sprite 的 bounding box 的左,上,右,下的值

示例:
在 message window 檢測圖象 sprite 1 矩形邊的值
put the rect of sprite 1

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

inflate

語法:
inflate (任何rect,寬度的改變值,高度的改變值)

說明:
改變 rect 的大小,其大小的改變為改變值的兩倍

示例:
inflate ( rect ( 0 , 0 , 100 , 100 ), - 10 , - 10 ) --原來的矩形長寬各為 100

rect ( 10 , 10 , 90 , 90 ) --inflate后的矩形長寬各為 80

--------------------
范例: 改變圖片的大小

效果:

放置一個變大的按鈕及一個變小的按鈕,再放置一張圖片在舞臺上,當變大及變小按鈕按住不放時,圖片持續變大或變小

制作步聚:

1. 放置一張圖片在 channel 1,在 channel 2、3 插入兩個 push button 分別起名為變大和變小

2. 在 frame 中加入 go to the frame 語句使之循環播放

3. 選擇"變大"按鈕,設置 lingo,如下所示

on mousedown
repeat while the mousedown
set the rect of sprite 1 = inflate ( the rect of sprite 1 , 1 , 1 )
updatestage
end repeat
end

4. 選擇"變小"按鈕,設置 lingo,如下所示

on mousedown
repeat while the mousedown
set the rect of sprite 1 = inflate ( the rect of sprite 1 , - 1 , - 1 )
updatestage
end repeat
end

相關附件

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 共和县| 阜城县| 金门县| 宁安市| 黄陵县| 外汇| 古交市| 元阳县| 晋江市| 北海市| 西城区| 扎赉特旗| 诸暨市| 靖安县| 长乐市| 怀集县| 冀州市| 嘉峪关市| 商都县| 安吉县| 深水埗区| 马关县| 星子县| 旌德县| 鹤庆县| 龙海市| 赣州市| 隆回县| 梅州市| 乳源| 定州市| 绥棱县| 柏乡县| 边坝县| 类乌齐县| 郴州市| 始兴县| 任丘市| 山西省| 广元市| 广南县|