Page 1 of 1

Colour select

Posted: Thu Jan 05, 2012 10:59 pm
by yarickyarick
In general ... I'm doing a character editor ...
Set as has all of the sex change, to edit the number of mucus in the nose at the future of children ...
But goes terribly problem with hair color ...
It seems to be writing:

Code: Select all

     love.graphics.setColor (rcvet, gcvet, bcvet, 255)
     love.graphics.draw (hea1, 160, y11)
     love.graphics.setColor (rcvet, gcvet, bcvet, 255)
     love.graphics.draw (chu1, 480, y12)
But for some reason the image does not change color, and screen ...
I do not even tell me please: what to do ...

Re: Colour select

Posted: Thu Jan 05, 2012 11:22 pm
by MarekkPie
Don't quite know what you are asking, but I'll take a few stabs at it.

Whatever the last setColor() set the color to is held until a new setColor() is called. So if I did something like:

Code: Select all

-- First time
function love.draw()
  love.graphics.circle("fill", 50, 50 10)  -- <= Default color
  love.graphics.setColor(255,0,0,255)
  love.graphics.circle("fill", 100, 100, 10) -- <= Red
end
Then the second time love.draw() is called, you get:

Code: Select all

-- Second time
function love.draw()
  love.graphics.circle("fill", 50, 50 10)  -- <= Red
  love.graphics.setColor(255,0,0,255)
  love.graphics.circle("fill", 100, 100, 10) -- <= Red
end
What I would do is after (or before) you have finished (or started) coloring stuff, reset the color by calling love.graphics.setColor(255,255,255,255). Alternatively, you could just make sure you don't have any dangling images that don't have a color associated with them.

That may not be your problem, because it looks like you made everything nice and tidy. But if you have any dangling draws somewhere, those might be affected.

Is 'hea1' = head? I don't know what 'chu1' would be.

Re: Colour select

Posted: Fri Jan 06, 2012 12:15 am
by yarickyarick
Hea1 = long hair
Chu1 = bang
Or problems and no solution ...
I'll ask again added to my Skype or ICQ, which I have in the last topic =)