Forum Discussion

hsrad's avatar
hsrad
Visitor
11 years ago

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

9 Replies

  • 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.
  • 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
  • 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
  • It's not REALLY static. It's updated every 10 mins with a web service call
  • "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?
  • 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.
  • 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
  • "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.
  • "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.