image color problem

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
dar0n123
Prole
Posts: 7
Joined: Fri Nov 25, 2011 6:10 pm

image color problem

Post by dar0n123 »

+
Last edited by dar0n123 on Thu Oct 30, 2014 4:40 pm, edited 1 time in total.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: image color problem

Post by vrld »

The image is set to black before drawing the image (the second love.graphics.setColor(0,0,0)).
You can fix this by either disabling color modulation[/url] or setting the color to white before drawing the image:

Code: Select all

love.graphics.setColor(255,255,255)
love.graphics.draw(man, manx, many)
Also, your first love.graphics.print() will be tinted white, because all love.graphics functions that draw stuff use the most currently set color. Think of love.graphics.setColor as picking a crayon of a specific color which you use to draw stuff. The corrected code:

Code: Select all

function love.draw()
    love.graphics.setColor(255,255,255)
    love.graphics.draw(man, manx, many)

    love.graphics.setColor(0,0,0)
    love.graphics.print("x="..manx, 1, 1)
    love.graphics.print("y="..many, 1, 13)
end
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
dar0n123
Prole
Posts: 7
Joined: Fri Nov 25, 2011 6:10 pm

Re: image color problem

Post by dar0n123 »

+
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest