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

roImageCanvas and ClearLayer()

Stupid question !

I have a canvas with 5 layers. I have an image on index 1 that I want to reposition. I have tried everything to try and delete the first instance and reposition the image to a new location. All I get is multiple images.

How do I delete the image ? I tried everything except to delete the canvas and start over, Clear(), ClearLayer(), SetLayer(), SwapLayer().

What I'm trying to do is a screen saver that moves an image and text around the screen .
0 Kudos
4 REPLIES 4
kbenson
Visitor

Re: roImageCanvas and ClearLayer()

Are you using multiple canvas objects? From what I remember, I haven't had any problems with this on a single canvas, but multiple canvas items require you to call .show() on the back ones first (with a small delay between them), otherwise the back canvas can't refresh and wipe out any drawing that happened on top of it.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
TheEndless
Channel Surfer

Re: roImageCanvas and ClearLayer()

If you're using a single canvas, then calling SetLayer() on that layer should replace anything that's currently on it with the new content.
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
renojim
Community Streaming Expert

Re: roImageCanvas and ClearLayer()

Are you using "Source_Over"? ClearLayer() won't work like you want if you're using "Source_Over".

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
greubel
Visitor

Re: roImageCanvas and ClearLayer()

Yes, I am using "Source_Over" !

Thanks !
0 Kudos