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

Canvas render issue since new Roku UI

Since I've had Roku 3 I notice my channel is having a display issue. Here's what I'm seeing:

1. Open any other channel like Netflix.
2. Go back to home screen.
3. Open my channel.
4. Header and background of Netflix channel displays, but audio from my channel plays.
5. Pressing any directional button on the keyboard causes my channel to render.
6. My channel continues to display fine after this point.

I never saw this until the Roku 3 update.

Edit: I found a way to prevent it, but at a cost:

Normally I create a screen like so:


function ui_screen_create(options) as object
canvas = CreateObject("roImageCanvas")
canvas.SetMessagePort(options.port)

screen = {

...lots of methods and properties...

paint: function()
m.canvas.AllowUpdates(false)
m.canvas.Clear()
...do some drawing of elements here...
m.canvas.Show()
m.canvas.AllowUpdates(true)
end function
}


The paint method draws the screen and has always worked fine till this problem. I noticed if I comment out the m.canvas.AllowUpdates methods, then the issue goes away. Problem is the screen changes then become somewhat glitchy and I can see flashes in between layout changes.

Any ideas on how to resolve this while still using AllowUpdates?
0 Kudos
5 REPLIES 5
RokuJoel
Binge Watcher

Re: Canvas render issue since new Roku UI

Can you modify your code to force the channel to render on launch, then after that, return to normal behavior? This is likely to be related to a known bug where previously displayed screens are sometimes visible when a channel launches.

- Joel
0 Kudos
Corgalore
Visitor

Re: Canvas render issue since new Roku UI

"RokuJoel" wrote:
Can you modify your code to force the channel to render on launch, then after that, return to normal behavior? This is likely to be related to a known bug where previously displayed screens are sometimes visible when a channel launches.

- Joel


Joel,

Yeah, I'll try to do that. Was this bug introduced when the new UI launched? Also, what component has the bug? Canvas?
0 Kudos
Corgalore
Visitor

Re: Canvas render issue since new Roku UI

Joel,

I'm having mixed results when trying to get this to work. It almost seems as if my screen is drawing, but the old screen from either another channel or my channel is rendering overtop of the newly rendered screen. I could be wrong, but as soon as I press a button on the remote, the old screen disappears and everything works fine.

Any ideas or sample code I can use to completely clear the channel screen before drawing my screens?
0 Kudos
greubel
Visitor

Re: Canvas render issue since new Roku UI

I had a simular issue using layer 0.
If I loaded an image as a background, the screen would go wacko. Even displayed previous channel content. Dynamic text would start to merge instead of replacing.
Changed it to display a color for the full screen, then the background image. Then the screen worked as expected.
Also it would work if you used layer 1 and just leave 0 alone.
0 Kudos
Corgalore
Visitor

Re: Canvas render issue since new Roku UI

So I was able to work around the issue. The issue seemed to be resolved by making each canvas screen use its own message port. I was sharing the same message port throughout most of the channel, which worked fine in version 3 and 4 of the SDK, but not in the latest version.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.