Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kfamily7
Reel Rookie

How to edit a text label from BRS file

Hey, new here, was wondering how could I edit a text label defined in the XML, from the brightscript file. Thanks.

0 Kudos
2 REPLIES 2
sanity-check
Roku Guru

Re: How to edit a text label from BRS file

Make sure your label has an ID in XML, e.g. id="mylabel", then you can do:

mylabel = m.top.findNode("mylabel")
mylabel.text = "My new text"

 

philanderson777
Roku Guru

Re: How to edit a text label from BRS file

Yes as per documentation all these fields can easily be manipulated for text node

 

https://developer.roku.com/en-gb/docs/references/scenegraph/label-nodes/label.md 

 

  height="44"
  width="0"
  font="font:MediumBoldSystemFont"
  text = "Application Development Made Easy!"
  horizAlign = "left"
  vertAlign = "center"
  translation="[318,8]

 

mylabel.translation = [330,8]   for example

0 Kudos