joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2017
01:31 PM
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
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?
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
- « Previous
-
- 1
- 2
- Next »