Author Topic: Zoom a 2d sprite to exact pixels!  (Read 1605 times)

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Zoom a 2d sprite to exact pixels!
« on: 2010-Feb-24 »
Hello There,

ZOOMSPRITE command zooms a sprite with a relative value. I wonder if there is any way to zoom a sprite within a fixed rectangle? I want to use this to create the background of my buttons, just like in html decorating an image into a table baclground...

Thanks,

Özden

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4144
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Zoom a 2d sprite to exact pixels!
« Reply #1 on: 2010-Feb-24 »
If I'm understanding you correctly you can either use POLYVECTOR on your sprite or draw it (with ZOOMSPRITE) to the backbuffer and GRABSPRITE and then use that sprite for your background.

Remember if you don't want artifacts, then use SMOOTHSHADING FALSE before using ZOOMSPRITE.
I came. I saw. I played.

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: Zoom a 2d sprite to exact pixels!
« Reply #2 on: 2010-Feb-24 »
Hello Ian,

Thanks for your reply. I think zooming won't be any kind of help to me, so I'm writing a function which draws a tile with the width that I want...

Özden

MrTAToad

  • Guest
Re: Zoom a 2d sprite to exact pixels!
« Reply #3 on: 2010-Feb-24 »
What about STRETCHSPRITE ?

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: Zoom a 2d sprite to exact pixels!
« Reply #4 on: 2010-Feb-25 »
Yay, didn't know this command, thank you very much... =D