Page 1 of 1
zoom in the screen?
Posted: Mon Nov 08, 2021 10:34 pm
by _SleepyWhirl_
hello, just wanted to ask if its possible to somehow zoom the screen in to make the viewfield smaller?
Re: zoom in the screen?
Posted: Tue Nov 09, 2021 6:39 am
by deice
while the
camera class does have "width" and "height" fields you can change, this doesn't actually zoom the screen in, just cuts the screen visibility off.
what you can do is create a
capture buffer to copy everything on screen into a renderable texture, then just redraw it scaled over everything else (i don't exactly remember so someone is free to correct me, but i believe that scaling a texture is possible using glDraw?).
Re: zoom in the screen?
Posted: Tue Nov 09, 2021 7:29 am
by Emral
While it's not documented on the docs yet, I recommend checking out handycam.lua in the scripts folder. I thinkkkkk you access the zoom via handycam[1].zoom = 2 for instance?
Re: zoom in the screen?
Posted: Tue Nov 09, 2021 8:25 am
by deice
Enjl wrote: ↑Tue Nov 09, 2021 7:29 am
While it's not documented on the docs yet, I recommend checking out handycam.lua in the scripts folder. I thinkkkkk you access the zoom via handycam[1].zoom = 2 for instance?
i just tested, you indeed can do that. i actually didn't know about this library at all (thanks for mentioning it lol), and since it already does what i described in my previous post for you, it's an unequivocally better solution.
Re: zoom in the screen?
Posted: Tue Nov 09, 2021 3:22 pm
by _SleepyWhirl_
thank yall!
Added in 6 hours 33 minutes 51 seconds:
Enjl wrote: ↑Tue Nov 09, 2021 7:29 am
While it's not documented on the docs yet, I recommend checking out handycam.lua in the scripts folder. I thinkkkkk you access the zoom via handycam[1].zoom = 2 for instance?

Re: zoom in the screen?
Posted: Tue Nov 09, 2021 10:16 pm
by Marioman2007
_SleepyWhirl_ wrote: ↑Tue Nov 09, 2021 9:56 pm
thank yall!
Added in 6 hours 33 minutes 51 seconds:
Enjl wrote: ↑Tue Nov 09, 2021 7:29 am
While it's not documented on the docs yet, I recommend checking out handycam.lua in the scripts folder. I thinkkkkk you access the zoom via handycam[1].zoom = 2 for instance?
Code: Select all
local handycam = require("handycam")
handycam[1].zoom = VALUE
Re: zoom in the screen?
Posted: Tue Nov 09, 2021 11:33 pm
by _SleepyWhirl_
thanks you! it worked very well!