Page 1 of 1

noobie stuck at beginning. Need help!

Posted: Mon Feb 01, 2021 7:12 pm
by danflavinist
I start learning lua. Yesterday everything was going perfect to me then something I don't really know happened and can't open window. I changed absolutely nothing but today I cannot set background or place graphics, text etc. Here is code example but nothing actually works correct
https://paste.ubuntu.com/p/xRJFdGx6TH/

Re: noobie stuck at beginning. Need help!

Posted: Mon Feb 01, 2021 9:18 pm
by darkfrei
danflavinist wrote: Mon Feb 01, 2021 7:12 pm I start learning lua.

Code: Select all

love.graphics.setBackgroundColor(244/255, 100/255, 100/255)
love.graphics.setColor(233/255, 0, 233/255)

Re: noobie stuck at beginning. Need help!

Posted: Tue Feb 02, 2021 5:59 pm
by MorbusKobold
darkfrei wrote: Mon Feb 01, 2021 9:18 pm
danflavinist wrote: Mon Feb 01, 2021 7:12 pm I start learning lua.

Code: Select all

love.graphics.setBackgroundColor(244/255, 100/255, 100/255)
love.graphics.setColor(233/255, 0, 233/255)
The reasoning for this is:
The Function setColor or setBackgroundColor wants Numbers between 0 and 1, not 0 to 255 as its Parameters.

See Documentation: https://love2d.org/wiki/love.graphics.setColor or https://love2d.org/wiki/love.graphics.s ... roundColor

Re: noobie stuck at beginning. Need help!

Posted: Tue Feb 02, 2021 9:41 pm
by darkfrei
It will be nice to have any format:

Code: Select all

r=r>1 and r/255 or r
g=g>1 and g/255 or g
b=b>1 and b/255 or b

Re: noobie stuck at beginning. Need help!

Posted: Tue Feb 02, 2021 9:48 pm
by dusoft
Actually 0-255 format was supported in the previous versions, so now the easiest way is just to divide by 255 as suggested.