Scaling with a mousepress.
Posted: Tue Jul 27, 2010 6:57 pm
Hi guys,
New Love type person here and I'm trying to figure all this out as best I can, but I've run into a problem. I searched the forums and haven't found this specific problem so thanks in advance.
I'm trying to get an image to scale larger over time as a mouse button is pressed down. As it stands the image only scales at a fixed amount once on a press, but when I use key presses it keeps getting bigger like I want.
I'm sure this is a pretty nub question, but its driving me nuts. Thanks again.
New Love type person here and I'm trying to figure all this out as best I can, but I've run into a problem. I searched the forums and haven't found this specific problem so thanks in advance.
I'm trying to get an image to scale larger over time as a mouse button is pressed down. As it stands the image only scales at a fixed amount once on a press, but when I use key presses it keeps getting bigger like I want.
Code: Select all
function love.update(dt)
x, y = 400 , 300
if love.keyboard.isDown("up") then
sy = sy + 10 * dt -- this works
sx = sx + 10 * dt -- this works too
end
if love.keyboard.isDown("down") then
sy = sy - 10 * dt -- this works too
sx = sx - 10 * dt -- this works too
end
function love.mousepressed(x, y, button)
if button == 'l' then
sx = sx * 100 * dt -- not working like I want
sy = sy * 100 * dt -- not working like I want
end
end