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: 
cpjamloki
Visitor

Fitting text alignment under roScreen


Function createOverlayBox(x, y,w,h,a)

black=&h000000FF
font_registry = CreateObject("roFontRegistry")
font = font_registry.GetDefaultFont(19, true, false)
m.screen.DrawRect(x,y, w, h, &hFFFFFFFF)
m.screen.DrawText(a.text,x+10,y+20,black,font)

End Function


in above code i am using roScreen and there is black ractangle is behind my text., which is drawing good but problem is that text is not fitting inside rect it's not wrapping here, because text length is bigger than rect.
is there any solution like imageCanvas(Text Attribute alignment)
0 Kudos
1 REPLY 1
TheEndless
Channel Surfer

Re: Fitting text alignment under roScreen

You'll need to measure the text and clip it yourself. The code here might help: viewtopic.php?f=34&t=64824&p=415822
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos