Why is setColor glitching my image?
Posted: Fri Aug 16, 2013 12:17 am
I feel stupid for asking such a simple question, but I'm just really banging my head on this one. Basically what I'm trying to achieve is to draw a blue rectangle background in one color, and then switch back to the default color (which I belive is 255,255,255,255, correct?), to draw my other graphics (in this case a logo), except things are glitiching out.
The portion of my code where (I believe) this is happening is as follows:
I attached a screenshot. As you can see, the logo is drawn as a pure white rectangle, rather than the logo itself (note that it has a transparent background.)
This is not the firs time setColor has messed me up . Could someone explain why this is going on? Thanks!
The portion of my code where (I believe) this is happening is as follows:
Code: Select all
local logo = graphics.newImage 'img/logo.png'
function Titlescreen()
return {
draw = function()
graphics.setColor { 100, 200, 255, 255 }
graphics.rectangle('fill', 0, 0, the.canvas:getWidth(), the.canvas:getHeight())
graphics.setColor(255, 255, 255, 255)
graphics.draw(logo, 100, 30, 0, 0.3, 0.3)
end,
--[[ More codez here... ]]
}
end
This is not the firs time setColor has messed me up . Could someone explain why this is going on? Thanks!