color problem with dots and lines

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
TheAutomator
Prole
Posts: 12
Joined: Wed Jun 04, 2014 9:25 am

color problem with dots and lines

Post by TheAutomator »

hi everyone :)
the first time i'm programming with the love engine!

there is only one thing bothering me when i use the draw functions..
if i draw e.g. a dot (1 pixel) or a rectangle (outline, not filled) the color and thickness of the
lines or dots is wrong.

the dots are very dark, not the full color they used to be and to big.
if i draw a square filled one pixel big then the size and color is perfect, just a pixel like i want but a dot is thicker and darker...

can someone help me with this small problem?

Thanks in advance,
TheAutomator
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: color problem with dots and lines

Post by micha »

Hi and welcome to the forum.

If the line width is very thin, then the color might get mixed with the background color. You can try setting the line style to "rough". See setLineStyle.

If that does not help, then please post a .love file of your code. That will make it much easier for us to help you.
TheAutomator
Prole
Posts: 12
Joined: Wed Jun 04, 2014 9:25 am

Re: color problem with dots and lines

Post by TheAutomator »

take a look at the file pleas :)
tested "rough" and "smooth" but nothing helps..
drawing just one pixel on the screen in its full color is not possible with "point" I guess?
Attachments
look at the file
look at the file
Naamloos.png (5.61 KiB) Viewed 2297 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: color problem with dots and lines

Post by Robin »

Add (or subtract) 0.5 to all the coordinates. The problem is a miscommunication between different parts of the underlying system — for some (0, 0) means the upper-left corner of the pixel in the upper left corner, for some it means the middle of the pixel in the upper left corner. Moving dots and lines by 0.5 fixes that problem.
Help us help you: attach a .love.
TheAutomator
Prole
Posts: 12
Joined: Wed Jun 04, 2014 9:25 am

Re: color problem with dots and lines

Post by TheAutomator »

Thank you for the help!
TheAutomator
Prole
Posts: 12
Joined: Wed Jun 04, 2014 9:25 am

Re: color problem with dots and lines

Post by TheAutomator »

Ok, thanks for the help!
(I already replied to say thank you but for some reason that post is not appearing..)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests