Code: Select all
love.graphics.setColor( 228/255, 6/255, 38/255, 1)
Code: Select all
-- in love.load() for example
Settings.myColor = { 228/255, 6/255, 38/255, 1 }
-- Later in my draw()
love.graphics.setColor(Settings.myColor)
Code: Select all
love.graphics.setColor( 228/255, 6/255, 38/255, 1)
Code: Select all
-- in love.load() for example
Settings.myColor = { 228/255, 6/255, 38/255, 1 }
-- Later in my draw()
love.graphics.setColor(Settings.myColor)
Code: Select all
love.graphics.setColor(Settings.myColor)
Code: Select all
local arguments = { 4, 2, 1 }
local myFunction = function ( arg1, arg2, arg3 )
print(arg1, arg2, arg3) -- prints: 4, 2, 1
end
myFunction ( unpack(arguments) )
Code: Select all
local arguments = { 4, 2, 1 }
local myFunction = function ( arg1, arg2, arg3 )
print(arg1, arg2, arg3) -- prints: 4, 2, 1
end
myFunction ( arguments[1], arguments[2], arguments[3] )
Also, please use Support forum for this kind of questions.cloudfrog wrote: ↑Mon Feb 21, 2022 8:52 am A sample is worth a thousand words. Take the following line:
I want to define my color value elsewhere, and then set it when needed. I don't want to have to store r,g,b,a separately though. Below is what I would like to do, just not sure exactly how.Code: Select all
love.graphics.setColor( 228/255, 6/255, 38/255, 1)
Code: Select all
-- in love.load() for example Settings.myColor = { 228/255, 6/255, 38/255, 1 } -- Later in my draw() love.graphics.setColor(Settings.myColor)
Code: Select all
Settings.debugCollisionColor = { 228/255, 6,255, 38/255 , 1}
Users browsing this forum: No registered users and 6 guests