Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joycewang
Visitor

Scene Graph XML: dynamic width of a Label

Is there any way to get the dynamic width of a Label in Scene Graph XML? I'm asked to provide a dynamic focus box around a label and need to know the dynamic width.
Normally I just use roFont.GetOneLineWidth(), but it seems roFont cannot be used in Scene Graph XML. Is there any properties in Label that I can get it's width or some other approaches?

Sample code would be great helpful. thanks in advance.
Tags (1)
0 Kudos
2 REPLIES 2
MediaDev
Visitor

Re: Scene Graph XML: dynamic width of a Label

Please try using boundingRect() after the label is set.

Regards
Media dev
Tags (1)
0 Kudos
youssefsherif
Streaming Star

Re: Scene Graph XML: dynamic width of a Label

how can i do that?

0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!