jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2011
11:18 PM
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
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!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
2 REPLIES 2

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2011
11:23 PM
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2011
01:28 PM
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
- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!