现在的位置: 首页 >> 多媒体 >> Director >> Lingo应用之repeat while
添加时间:2005-10-29 来源:网教中国 作者: unknown
Lingo应用之repeat while

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

相关附件
上一篇:Director 动态事件传递(1) 下一篇:Director Lingo应用之repeat with
大部分文章摘自网上,如有侵犯您的权益请与我们联系,我们会第一时间进行处理,谢谢! [ 打印文章 ] [ 关闭窗口 ]
推荐文章
 
相关文章
·Director Lingo应用之repeat wit
最新文章
·发布Director MX 2004
·DirectMedia Xtra 在 Director
·Speech Xtra 应用(Director MX
·谈谈Director作品的发布模式
·关于多媒体程序运行速度的研究
·Director MX 2004教程--哪些人适
·Director MX 2004教程--常用多媒
·Director MX 2004教程--为什么选
·Director MX 2004教程--Director
·Director MX 2004教程--Director
Google