camera life struggles

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.
Post Reply
RBXcpmoderator12345
Citizen
Posts: 59
Joined: Sat Mar 07, 2015 11:53 pm

camera life struggles

Post by RBXcpmoderator12345 »

help me
i cant move the cam
and also 'camerax' is just a variable name, it has nothing to do with the camera's x value.
Attachments
FiveNightsAtOffTopic.love
(6.16 MiB) Downloaded 99 times
Joe Black
Prole
Posts: 39
Joined: Wed Jan 21, 2015 1:57 pm

Re: camera life struggles

Post by Joe Black »

for the camera, you missunderstood how it works

camera:set() must be called before the draw of element translated and camera:unset() return the draw to the previous position

I'm not very clear... , the camera:set rotate, rescale and translate all draw following and camera:unset() remove those action.

in love.draw in the elsif bloc do that and see the result.

Code: Select all

109                 camera:set()
110                 love.graphics.draw(background, 0, 0, 0, sx, sy)
111                 love.graphics.draw(wires)
112                 camera:unset()
113                 love.audio.stop(theme)
114                 night1 = true
115                 if camerax == true and camNum == 1 then
116                         camera:move(0.5, 0.5)
117                         camOn = true
118                 end
also see the attachment press q and c and it works.
Attachments
help.love
(6.16 MiB) Downloaded 91 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests