jlfreund
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2013
01:50 PM
DrawText on roScreen
Hi,
I have an app with an roScreen, and I can do a DrawRect, DrawObject, and DrawScaledObject successfully, however when I try DrawText, I get no output from that call.
also tried drawing text into a region (like the simple2D example) but still no output.
It's odd that the font and fontReg variables don't seem to contain anything when printing with printAA. However I get the same output from the simple2d sample code -- which does display text correctly.
Any suggestions for getting DrawText to work?
I have an app with an roScreen, and I can do a DrawRect, DrawObject, and DrawScaledObject successfully, however when I try DrawText, I get no output from that call.
screen = CreateObject("roScreen", true, 1280, 720)
fontReg = CreateObject("roFontRegistry")
font = fontReg.GetDefaultFont()
screen.DrawText("Hello", 100, 100, &hFF00FF00, font)
screen.SwapBuffers()
also tried drawing text into a region (like the simple2D example) but still no output.
drawingRegion = dfSetupDisplayRegions(screen, 100, 100, 400, 60)
s = drawingRegion.main
s.DrawText("Hello", 100, 100, &hFF00FF00, font)
It's odd that the font and fontReg variables don't seem to contain anything when printing with printAA. However I get the same output from the simple2d sample code -- which does display text correctly.
---- AA ----
Nothing from for each. Looks like : ?roFontRegistry?
------------
---- AA ----
Nothing from for each. Looks like : ?roFont?
------------
Any suggestions for getting DrawText to work?
3 REPLIES 3

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2013
02:00 PM
Re: DrawText on roScreen
Colors are specified in RGBA order. So your color &hFF00FF00 is completely transparent. Try using FF in the low order byte.
--Mark
--Mark

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2013
05:59 PM
Re: DrawText on roScreen
"RokuMarkn" wrote:
Colors are specified in RGBA order. So your color &hFF00FF00 is completely transparent. Try using FF in the low order byte.
--Mark
It's worth pointing out that this is the opposite of colors used on an roImageCanvas, which is ARGB.
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
jlfreund
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2013
10:34 PM
Re: DrawText on roScreen
Thanks! I was porting my layout code from roImageCanvas (which was too slow for my application). changing the color format fixed it.