For example:
I need draw rectangle with specific color, but i already have modified colors
Code: Select all
love.graphics.setColor(1, 0.5, 1)
love.graphics.rectangle("fill", 200, 200, 100, 100)
--and now, i need to draw another, but with specific color, but keep graphics state from 1st line
--so, i should do something like
local r, g, b = love.graphics.getColor()
love.graphics.setColor(0.4, 1, 0.5)
love.graphics.rectangle("fill", 0, 0, 100, 100)
love.graphics.setColor(r, g, b)
Code: Select all
--some draw staff here
love.graphics.setColor(1, 0.5, 1)
love.graphics.rectangle("fill", 200, 200, 100, 100)
--and now, i need to draw something with specific parameters
-- color now - 1, 0.5, 1
love.graphics.rectangle("fill", 0, 0, 100, 100, {r, g, b, a, etc}) -- so, if draw function have it own parameter, then it will be temporarily overwrited by this exact draw call
--color still - 1, 0.5, 1
love.graphics.rectangle("fill", 200, 200, 100, 100)