Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

ScaleRotateCenter problem

I am using an animation to animate a scale change. I want the item to scale up uniformly in all directions. I have the scaleRotateCenter property set to [width / 2, height / 2]. However, when I run my animation, the item grows to the right and downward direction from the top-left corner. Am I misunderstanding the use of scaleRotateCenter?
0 Kudos
Level 7

Re: ScaleRotateCenter problem

I am seeing this same issue.  Were you able to figure it out?
0 Kudos
Level 8

Re: ScaleRotateCenter problem

How are you accessing the height/width property of your node?
Be sure to use boundingRect() to get the proper values. 
Tyler Smith
0 Kudos
Level 7

Re: ScaleRotateCenter problem

Here is my code.  

<component name="TitleGridItem" extends="Group">
<field id="itemContent" type="node" onChange="showcontent" />
<field id="focusPercent" type="float" onChange="showfocus" />
<field id="gridHasFocus" type="boolean" onChange="showfocus"
alwaysNotify="true" />

<script type="text/brightscript">
    function init() = "markupgriditem"
      m.itemposter ="itemPoster")
      'm.itemmask ="itemMask")
      m.itemTitle ="itemTitle")
    end function
    function showcontent()
      itemcontent =
      '? itemcontent
      m.itemposter.uri = itemcontent.HDPOSTERURL
    end function
    function showfocus()
    if ( > .8-) then
    m.itemTitle.text =
    m.itemTitle.text = ""
    end if
scale = 1 + ( * 0.1)
m.itemposter.scale = [scale, scale]
'm.itemmask.opacity = 0.75 - ( * 0.75)
end if
    end function


<Poster id="itemPoster"  width="180" translation="[10,10]"
height="288" scaleRotateCenter="[ 90.0, 144.0 ]" loadDisplayMode="scaleToFit">
<Label id="itemTitle" width="190" height="30" horizAlign="center" />

0 Kudos
Level 7

Re: ScaleRotateCenter problem

Please try inheritParentTransform = "true" in the group tag of xml, which you are scaling.
0 Kudos