GLBasic forum

Main forum => GLBasic - en => Topic started by: Ozden79 on 2010-Feb-24

Title: Zoom a 2d sprite to exact pixels!
Post by: Ozden79 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
Title: Re: Zoom a 2d sprite to exact pixels!
Post by: Ian Price 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.
Title: Re: Zoom a 2d sprite to exact pixels!
Post by: Ozden79 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
Title: Re: Zoom a 2d sprite to exact pixels!
Post by: MrTAToad on 2010-Feb-24
What about STRETCHSPRITE ?
Title: Re: Zoom a 2d sprite to exact pixels!
Post by: Ozden79 on 2010-Feb-25
Yay, didn't know this command, thank you very much... =D