hi vrld,
Some question bout your camera script. Thanks for your guide all the time, especially the scripts provided
i have created a simple script, where arrow keys control my ball movement, WSAD keys control camera movement
And on right top corner, i show my debug messages, where they will always stick on screen even camera is moved
I realized there are 2 issue here, when i try to ZOOM my camera,
- it's not possible to scale everything EXCEPT my debug font
- and also while scaling the object, my debug font (which is image) will look ugly (attachment 20)
- also, can we zoom on particular X,Y point instead of always zoom the center?
Anyway to resolve two issues above?
Thanks again for the camera script!
HUMP camera lib script question
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
HUMP camera lib script question
- Attachments
-
- main.lua
- (3.27 KiB) Downloaded 150 times
Re: HUMP camera lib script question
I can't speak to the mechanics of HUMP, but the ugly image font is a bug which was recently fixed in the repository - that won't be a problem once 0.7.0 comes out. (Well, it'll still look blurry when scaled, but there won't be those hideous yellow lines.)
Re: HUMP camera lib script question
Without looking at your code yet, but based on
A zoom to a specific point is a combination of zooming and moving the camera, so you will need to adjust the camera position accordingly.
Edit: also, for setting the camera position you should not do which creates a new camera object, but rather
Zooming is also done by updating the zoom-field of the camera object (the documentation is lacking in that respect):
I guess you don't use camera:predraw() and camera:postdraw() correctly, but position the debug message so that it will appear where you want it to. That is not necessary. Put everything that should be seen by the camera into a camera:predraw()/camera:postdraw() pair and print the debug info afterwards:weilies wrote:when i try to ZOOM my camera,
- it's not possible to scale everything EXCEPT my debug font
Code: Select all
function love.draw()
cam:predraw()
... draw game-objects here ...
cam:postdraw()
... draw hud/debug info/everything that should not be affected by the camera here ...
end
I am not sure what you mean by that, but it guess not (like with a real camera).also, can we zoom on particular X,Y point instead of always zoom the center?
A zoom to a specific point is a combination of zooming and moving the camera, so you will need to adjust the camera position accordingly.
Edit: also, for setting the camera position you should not do
Code: Select all
gCamera = Camera(vector(vectorX, vectorY), vecZoom)
Code: Select all
gCamera.pos = vector(vectorX, vectorY)
Code: Select all
gCamera.zoom = gCamera.zoom + (cameraZoomSpeed * dt)
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 15 guests