Roku Developer Program

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

Hud Display For a 30 Second

I created one Hud in Roku. It Displayed successfully. But It's Required to press every time ok key. But I not write any code for ok key. I tried to set timmer here It's Display for 30 Seconds. But I'm not getting any idea which place set timmer so It work.  anyone know this situation.

my xml code is here

<Group id="hudgroup" opacity="0">
<LayoutGroup id="infogroup" layoutDirection="horiz" itemspacings="[27]" translation="[0,600]">
	<Rectangle id="background" width="1920" height="130" opacity="0.8" color="0x000000">
	   <Rectangle id="WhiteRectangle" color="0xFFFFFFFF" width="220" height="130">
	     <Poster id="poster" width="220" height="130" />
	   </Rectangle>
	   <Label id="title" font="font:MediumBoldSystemFont" translation="[230,10]" />
           <Label id="description" font="fontSmiley FrustratedmallestSystemFont" width="1000" wrap="true" maxLines="2" ellipsisText="..." translation="[230,60]" />
        </Rectangle>
</LayoutGroup>
<Animation id="slideanimation"	duration="3" repeat="false" easeFunction="linear">
       <FloatFieldInterpolator id="slideanimationinterpolator" key="[0, 0]" keyValue="[0.0, 1.0]" fieldToInterp="hudgroup.opacity" />
</Animation>
</Group>

My brightScript Code is Here.

sub OnContentChanged()
   item = m.top.content ' ?"m.top.content : "
   m.top.content m.title.text = m.top.content.title
   m.description.text = m.top.content.text
   m.poster.uri = m.top.content.hdposterurl
 if item <> invalid AND item.metadata <> invalid
   SetValue(m.title, item.metadata, "title")
   SetValue(m.description, item.metadata, "description")
   SetValue(m.poster, item.metadata, "poster") 
   ?"hud failed to set item"
 end if
end sub
function SetValue(node, item, field as String, defaultValue = "" as String)
  value = defaultValue
  if item.get(field) <> invalid then
   value = item.get(field)
  end if
' ?"value="value node.text = value
end function

Anyone know How doing I wrong Here.

0 Kudos