I'm trying to use the STI and Hump camera libraries in the same project, and seems to be impossible to make them work together. I can load a tiled map and I can define a Hump camera with a level of zoom of 2, but the result is that only seems to affect the sprites "outside" the tiled map. I put a screenshot with the effect. And of course changing the camera's position doesn't move the map. I think I'm followed the examples and documentation point by point, and I don't know if there is something I'm missing or maybe both libraries are not compatibles...
This is the image, as you can see only the sprite is resized by the hump camera:
The source code is pretty simple:
Code: Select all
function love.load()
initPos = HumpVector(200,300)
theHero = Hero(initPos, 'media/hero/adventurer_tilesheet.png')
theHero:walkFront()
levelMap = Tiled("media/levels/level_01.lua")
lastUpdateSpeed = 0.0
camera = HumpCampera(love.graphics.getWidth()/2,love.graphics.getHeight()/2, 2)
end
Code: Select all
function love.update(dt)
if love.keyboard.isDown('right','d') then
canMove = true
currentMovement = (theHero.speed*dt)
end
theHero.pos.x = theHero.pos.x + currentMovement
theHero:update(dt)
levelMap:update(dt);
camera:move(currentMovement,0)
end
function love.draw()
camera:attach()
levelMap:draw()
theHero:draw()
camera:detach()
end
Any help with this would be appreciated. Thanks in advance.