您现在的位置: 圆点视线 >> 教程 >> 媒体动画 >> Director >> 文章正文
director应用技巧         ★★★
director应用技巧
作者:佚名  文章来源:圆点视线  点击数:  更新时间:2005-12-27 18:43:49 
 页面功能:【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口 【字体:
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为佳。
 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 文章录入:apoints    责任编辑:apoints  【字体:
 
  • 上一篇文章:

  •  
  • 下一篇文章:
  • 最新文章
    相关文章
    Director怎样制作自定义光标
    用Director控制动画GIF
    flash和director之间的沟通技巧
    Director中控制声音音量的几种方法
    Director8行为库的应用
    用Director创建涂色板
    认识Director中的Xtra
    如何检测演员的载入进度
    对象列表的调用与删除
    用Lingo解决组合问题
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    发表评论:
     姓  名: 评 分: 1分 2分 3分 4分 5分
     评论内容: ·严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
    ·用户需对自己在使用本网服务过程中的行为承担法律责任
    ·本站管理员有权保留或删除评论内容。
    ·评论内容只代表机友个人观点,与本网站立场无关。
     
    最 新 推 荐
     
    百度主题推广
    最 新 热 门