简体   繁体   English

如何更改Roku Scenegraph动画节点上的插值器?

[英]How to change the interpolator(s) on a Roku Scenegraph animation node?

Taking an example from the Roku SDK docs: 以Roku SDK文档为例:

<Animation id="transAnimation"
       duration="1"
       repeat="true"
       easeFunction="linear" >
    <Vector2DFieldInterpolator id = "myInterp2"
        key="[0.0, 1.0]"
        keyValue="[ [640.0, 320.0], [100.0, 100.0] ]"
    fieldToInterp="myPoster.translation" />
</Animation>

After I've done a find on "transAnimation" is it possible to change the interpolator in brightscript code? 在我对“transAnimation”进行了查找后,是否可以在brightscript代码中更改插补器? There are interpolators present in the XML, but after the scenegraph is built they no longer appear as children of my animation node. XML中存在插值器,但在构建场景图之后,它们不再显示为我的动画节点的子节点。

Yes you can do that, find the interpolators with m.top.findNode and modify the reverse value like so 是的,你可以这样做,找到带有m.top.findNode的插值器,并像这样修改反向值

myInterp2 = m.top.findNode("myInterp2")  
myInterp2.reverse = true  

Assuming this is a toggle-able item you'll need to unset the reverse in the original animation: 假设这是一个可切换的项目,您需要在原始动画中取消设置反转:

myInterp2 = m.top.findNode("myInterp2")  
myInterp2.reverse = false  

HOWEVER, I just went through this last week and for some reason could not get it to work on Roku 4 despite it having 7.7 (worked fine on 1, 3, and ultra but on R4 it did not reverse?!), so rather than goof around with it for hours I went back to adding a separate animation to handle the reverse. 然而,我上周刚刚经历了这个问题并且由于某种原因无法让它在Roku 4上工作,尽管它有7.7(在1,3和超级工作正常但在R4上没有反转?!),所以不是几个小时左右,我回去添加一个单独的动画来处理反向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM