您现在的位置: 圆点视线 >> 教程 >> 媒体动画 >> Director >> 文章正文
批处理序列动画演员的注册点         ★★★
批处理序列动画演员的注册点
作者:佚名  文章来源:圆点视线  点击数:  更新时间:2005-12-27 18:39:42 
 页面功能:【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口 【字体:
在许多情况下,我们会用到比如Film Loop的序列动画。这时如果构成序列动画的每一张图形演员的注册点不统一,那么动画的效果就会大打折扣。虽然Director演员对应的编辑器为我们提供了调整注册点的工具,但是如果需要调整大量的图片则会非常的繁琐,不过我们可以写一个批处理程序来进行批量调整。

on AGSetRegpoint fMembersInfoList,fPointSetType
 if ilk(fMembersInfoList[1])=#list then
  if fMembersInfoList[1].count>=2 then
   tcastnum=fMembersInfoList[2]
  else
   tcastnum=1
  end if
  repeat with i in fMembersInfoList[1]
   if fPointSetType=#centered then
    member(i,tcastnum).centerRegPoint =true
   else
    member(i,tcastnum).RegPoint =fPointSetType
   end if
  end repeat
 else
  if fMembersInfoList.count>=3 then
   tcastnum=fMembersInfoList[3]
  else
   tcastnum=1
  end if
  repeat with i=fMembersInfoList[1] to fMembersInfoList[2]
   if fPointSetType=#centered then
    member(i,tcastnum).centerRegPoint =true
   else
    member(i,tcastnum).RegPoint =fPointSetType
   end if
  end repeat
 end if
end

  该函数的使用方法如下:

setregpoint([[1,2,3],],regpointSetMethod)
setregpoint([startMemberNum,endMemberNum,],regpointSetMethod)

  其中参数CastNum可选,如果不传递此参数则默认为1号演员表,regpointSetMethod的值可以为#centered或者一个point。

  例如,以下语句将2号演员表中的1、3、4号演员的注册点居中:

setregpoint([[1,3,4],2],#centered)

  以下语句将1号演员表中的1至4号演员的注册点居设为point(0,0):

setregpoint([1,4],point(0,0))
 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 文章录入:apoints    责任编辑:apoints  【字体:
 
  • 上一篇文章:

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