您的位置: 首页-> 电脑文摘-> 图象图形-> Director-> 正文

批处理序列动画演员的注册点
作者佚名 来源InterNet 加入时间:2005-2-7
在许多情况下,我们会用到比如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))


[文章录入员:nancy]

相关文章 相关软件:
::PCBOOKCN'ADS::


::Director::
PhotoShop
CorelDraw
3D-MAX
AutoCAD
FreeHand
Illustrator
Authorware
Director
Maya/Rhino
其它
::阅读排行::
·内存中对象的配置
·在Director中使用Powe...
·音频与数字视频、flash音频的...
·Director小技巧
·控制动画GIF
·认识Director中的Xtra
·Director中各种内部事件发...
·用Lingo解决组合问题
·Director8行为库的应用
·行为库创建技巧