Request for Camera Example in Love

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Request for Camera Example in Love

Post by zac352 »

You guys overcomplicated it...
Do something along the lines of this, it's similar to my camera script in Guvi.

Code: Select all

images={} --{x=x,y=y,img=image}
camera=vector4(0,0,1,0)

function love.draw()
love.graphics.push()
love.graphics.translate(camera.x,camera.y)
love.graphics.scale(camera.z)
love.graphics.rotate(camera.w)
for _,v in pairs(images) do
love.graphics.draw(v.img,v.x,v.y,0,camera.z,camera.z)
end
love.graphics.pop()
end
Hello, I am not dead.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Jipjang and 5 guests