网络软件系统工具应用软件图形图像多媒体类免费游戏安全相关免费音乐网页素材 电子书籍考试考题建站源码
教育教学多媒体类编程开发操作系统游戏天地娱乐天地简历求职站长专区网页设计安全技术图形图像文学驿站
业界资讯 | 图形图像 | 操作系统 | 网络冲浪 | 工具软件 | 办公软件 | 媒体动画 | 精文荟萃 | 认证考试 | 网页设计 | 技术开发 | 专栏
当前位置:热点网络学院媒体动画Directordirector应用技巧
精品推荐
热点TOP10
·Director生成文件减肥技巧
·用Director控制动画GIF
·Director怎样制作自定义光标
·利用director.ini调试应用程序
·director使用mui xtra创建对话框
·director应用技巧
·Director中控制声音音量的几种方法
·DIRECTOR去背技法步步高
·Director 3D 基础(之七)
·Director 3D 基础(之六)
·Director 3D 基础(之五)
·Director 3D 基础(之四)
·Director 3D 基础(之三)
·Director 3D 基础(之二)
·Director 3D 基础(之一)
·Director制作《七巧板》游戏
·【Director教程】lists的使用一则
·【Director教程】属性列表应用一则
·【Director教程】创建随机列表
·【Director教程】解析文本和列表
director应用技巧
日期:2006年10月15日 作者: 查看:[大字体 中字体 小字体]
1、设置movie,使之自动缩放以适应屏幕大小

A:使用如下script:
on preparemovie
(the stage).rect=(the desktoprectlist).[1]
(the stage).drawrect=(the desktoprectlist).[1]
end

2、制作带阴影效果的text

field可以作出阴影效果,但在field中应用中文容易死机,我们可以用一个text member但多个sprite,各sprite位置稍稍错开,并适当设置其blend即可。灵活使用之可以得到动态的和彩色的阴影。缺点是数量过多会拖累速度。

3、中文菜单

可以用installmenu的标准方法生成中文菜单,但字体、字号设置全部无效。

4、filmloop播放问题:在一帧内判断一个filmloop播放完毕,再继续播放下一帧。

frame script中含有以下代码,以实现‘‘定格\\‘‘:
on exitframe me
go the frame
end
再把以下behavior拖到filmloop sprite即可:
on exitframe me
--但用prepareframe不行?!
tell sprite(me.spriteNum)
if the frame = the lastframe then
ploopcnt = 1
end if
end tell
if ploopcnt then
go next   --或改为其它命令
end if
end

5、对filmloop的控制。

以下behavior的功能是用于一个filmloop sprite,点击暂停,再次点击则继续。
property ppause,pframe
on beginsprite me
ppause=false
pframe=1
end

on mouseup me
ppause=not ppause
if ppause then
tell sprite(me.spriteNum) to pframe=the frame
end if
end

on exitframe me
if ppause then
if pframe=1 then
tell sprite(me.spriteNum) to go to the lastframe
else
tell sprite(me.spriteNum) to go to pframe-1
end if
end if
end
由此我们也可以知道,我们无法使filmloop的播放速度快于movie,但可以用上法的变通来减慢它。
补充说明:tell sprite...用法类似tell window,但尚未见于正式文档,我使用至今,尚未见其出错。

6、在projector用lingo关闭计算机(用于Windows9X),主要用于触摸屏等无人值守的情况等。

A:无论此时计算机是否有打开的程序或窗口,使用下面的lingo语句可直接关机:(仅限于projector)
open ‘‘c:\\windows\\rundll.exe user.exe,exitwindows‘‘
若要重新启动计算机,改为 ‘‘c:\\windows\\rundll.exe user.exe ,exitwindowsexec‘‘
当然在实际的projector中不能直接用‘‘c:\\windows‘‘,而要用fileio的getosdirectory()等函数先获得系统相应目录。

7、在runtime动态地改为Director内置的图标

最常用和简单的方法是对于一个sprite,施与以下behavior:
on beginsprite me
sprite(me.spriteNum).cursor=280 --手形光标
end
一般的光标设置以上一句就够了,更具个性化的光标设置这里不谈了。

内置图标(有些是相同的):0-4 200 254 256-269 271-272 280-281 284-286 290-304

8、Lingo支持递归!

用到搜索算法的朋友们应该高兴吧。

9、director中事件发生的顺序

prepareMovie
beginsprite for frame 1
stepFrame for frame 1
prepareframe for frame 1
startMovie
enterFrame for frmae 1
exitfrmae for frame 1

beginsprite for next frame

10、设置搜索路径的合适位置

A:实际上,在prepareMovie前,所用到的cast及相关的member包括其链接关系都应作好准备。
所以不可在movie内为自身设置搜索路径。一般在stub player中设置searchpath为佳。

(出处:http://www.xmsc.com.cn

关于我们 | 帮助(?) | 版权声明 | 友情连接 
Copyright 2005-2005 xmsc.com.cn All Rights Reserved.
Powered by:mesky