Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
cpjamloki
Level 7

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
TheEndless
Level 7

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