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: 
jbrave
Channel Surfer

Scaling Sprites

It seems a bitmap is a property of a region
a region is a property of a sprite
drawscaledbitmap is a property of a screen

What is the simplest method of scaling a sprites bitmap? I want to scale some sprites to a fixed pixel width and then move them using sprite.moveto(x,y), but I'm not sure how to do this. I have sprites on screen, they are moving as I want them to, but I want to shrink em & keep em shrunk.

Anyone?

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
2 REPLIES 2
TheEndless
Channel Surfer

Re: Scaling Sprites

roBitmap, roRegion, and roScreen all implement the ifDraw2D interface, so you can DrawScaledObject to any one of them. If you want to scale a sprite permanently, then I'd probably draw it to a bitmap scaled, then use that bitmap throughout the rest of the app. The scaleblit.brs file in the Simple2D sample shows and example of how to do this.
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
jbrave
Channel Surfer

Re: Scaling Sprites

Thanks for the suggestion, I got it working, the biggest issue being that the scaling factors are percentages, not pixels, so 0.50 instead of 50.0

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
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.