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: 
joetesta
Roku Guru

Re: Get Font from Label in BrightScript?

easy? easy for you to say 🙂
for sure there's more than one way to make it dynamic but probably the way to go is add a field to the custom component (that as you said, extends label) add a new field like
<field id="parentWidth" type="float" onChange="trimLabel" alwaysNotify="true"/>


then in your custom component's brs code you have the function "trimLabel" reference m.top.parentWidth to know what its desired target width is.  make sense?
oh yeah, you'll still need some way to set this field from the parent...  Will be a little tricky but believe it can be done via content, add a parentWidth field to the contentNode.... or maybe there's an easier way to reference those items... the custom component itself might calculate the width (use boundingRect().width) given the content?
aspiring
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.