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: 
hsrad
Level 7

roImageCanvas and roScreen

Is it wrong to try to have roImageCanvas and roScreen at the same time? I want to use roImageCanvas for parts of the screen that has static text and image and roScreen for the more complex part of the screen.
If that is fundamentally wrong, then how bad is using DrawText? SDK docs say they should not be used extensively
0 Kudos
9 Replies
TheEndless
Level 7

Re: roImageCanvas and roScreen

You can't mix the two, unfortunately. If you have static text, you could draw it to a bitmap once, then draw that bitmap to the screen on subsequent updates.
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
RokuMarkn
Level 7

Re: roImageCanvas and roScreen

DrawText is more expensive than DrawObject, but you shouldn't assume that you should avoid it all costs. It's certainly feasible to do DrawTexts on every frame, even in an app with animation. I would use DrawText initially and determine based on performance whether you need to optimize it.

--Mark
0 Kudos
Komag
Level 9

Re: roImageCanvas and roScreen

If the text is REALLY static, you could actually make it into an image instead (ahead of time, on your own), and just draw the image
0 Kudos
hsrad
Level 7

Re: roImageCanvas and roScreen

It's not REALLY static. It's updated every 10 mins with a web service call
0 Kudos
hsrad
Level 7

Re: roImageCanvas and roScreen

"RokuMarkn" wrote:
DrawText is more expensive than DrawObject, but you shouldn't assume that you should avoid it all costs. It's certainly feasible to do DrawTexts on every frame, even in an app with animation. I would use DrawText initially and determine based on performance whether you need to optimize it.

--Mark


I need to render about 30 words every 3 seconds. What's the threshold of "too many" drawText calls?
0 Kudos
Komag
Level 9

Re: roImageCanvas and roScreen

It will be a matter of opinion and how smooth you want everything to be. Drawing 30 words might hurt performance on older Rokus, depending on what else you're doing at the same time. If you set it up and see that it's unacceptable, you can try TheEndless' approach to help speed it up.
0 Kudos
NewManLiving
Level 7

Re: roImageCanvas and roScreen

from what I have seen drawtext does not have as much of an impact on open gl devices. On those without you have to be careful. ( the recent scrolling list example demonstrates that). However for occasional updates and depending on how much animation will be taking place along with the text update I would not expect a performance hit
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
EnTerr
Level 9

Re: roImageCanvas and roScreen

"hsrad" wrote:
I need to render about 30 words every 3 seconds. What's the threshold of "too many" drawText calls?

It's fairly high. Last year in my 2048 i was getting 30 fps on the oldest Rokus (fw3) and 60 fps on the 3k platform. I.e. the board and its contents are re-drawn at least 30 times per second, including cell numbers are DrawText-ed each frame - meaning that yes, 150 characters per second shouldn't be a problem even on the slowest device.

"TheEndless" wrote:
You can't mix the two, unfortunately. If you have static text, you could draw it to a bitmap once, then draw that bitmap to the screen on subsequent updates.

Has that been tested, that they are absolutely, positively "immiscible"?
I mean, i was so sure that one cannot show a roMessageDialog on top of a roScreen till dev42 showed us that "yes, you can". And recently i got the feeling that most ro-components were (or should have been) implemented internally via roImageCanvas.
0 Kudos
TheEndless
Level 7

Re: roImageCanvas and roScreen

"EnTerr" wrote:
Has that been tested, that they are absolutely, positively "immiscible"?
I mean, i was so sure that one cannot show a roMessageDialog on top of a roScreen till dev42 showed us that "yes, you can". And recently i got the feeling that most ro-components were (or should have been) implemented internally via roImageCanvas.

roMessageDialog is a different animal, as it's actually intended to be drawn on top of other screens, but I can't get that to work either (it blacks out the roScreen for me), and dev42 even states that key presses don't get sent predictably. But, to answer your question, yes I've tested it, and roImageCanvas and roScreen definitely don't work together.
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