noobie stuck at beginning. Need help!

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
danflavinist
Prole
Posts: 1
Joined: Mon Feb 01, 2021 7:02 pm

noobie stuck at beginning. Need help!

Post 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/
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: noobie stuck at beginning. Need help!

Post 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)
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
MorbusKobold
Prole
Posts: 3
Joined: Fri Jan 15, 2021 3:02 pm

Re: noobie stuck at beginning. Need help!

Post 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
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: noobie stuck at beginning. Need help!

Post 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
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
dusoft
Party member
Posts: 635
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: noobie stuck at beginning. Need help!

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests