how i can do this with setColor()
Posted: Tue Sep 15, 2015 9:06 pm
i want to print a text with a black color but if i want to restore the colors for the sprites(to keep the original colors) how i can do this with love.graphics.setColor(r,g,b,a)???
Code: Select all
function love.draw()
love.graphics.setColor(0,0,0,100)
love.graphics.setFont(mainFont) -- select the main font
love.graphics.print("Score: " .. tostring(score), _WIDTH, _HEIGHT) -- print score and
love.graphics.print("Lives: " .. tostring(lives), _WIDTH, _HEIGHT + (64)) -- lives on the screen
--HOW I CAN RESTORE THE COLORS FOR THE SPRITES.
--Draw stuff
love.graphics.draw(bg.img, 0, 0);
for i,bullet in ipairs(bullets) do
love.graphics.draw(bullet.img,bullet.x,bullet.y)
end
for i, enemy in ipairs(enemies) do
love.graphics.draw(enemy.img,enemy.x,enemy.y)
end
if isAlive then
love.graphics.draw(player.img, player.x - (player.w / 2), player.y - (player.h / 2) )
end
end