[SOLVED] Problem with graphics.setColor
Posted: Fri Feb 22, 2013 8:38 am
First of all, hello to you all!
I am having issues with using love.graphics.setColor.
In my love.draw()-function, I am drawing some images. Afterwards I want to draw a, let's say, green rectangle. But when I test my application, the entire Love-window goes green (and note, it's green transparent, even though I write 255 in alpha).
Here's my draw-function:
Why has my code gone ill?
I am having issues with using love.graphics.setColor.
In my love.draw()-function, I am drawing some images. Afterwards I want to draw a, let's say, green rectangle. But when I test my application, the entire Love-window goes green (and note, it's green transparent, even though I write 255 in alpha).
Here's my draw-function:
Code: Select all
function love.draw()
love.graphics.draw(bgimg, 0, 0)
love.graphics.draw(eng_bar, btn_eng.x, btn_eng.y)
love.graphics.draw(rot_bar, btn_rot.x, btn_rot.y)
love.graphics.draw(krot_btn_off, btn_krot.x, btn_krot.y)
love.graphics.draw(pship, shipmarker.x, shipmarker.y, deg_to_rad(orient_deg), 1, 1, shipmarker.w/2, shipmarker.h/2)
--love.graphics.setColor(0, 0, 0, 255)
love.graphics.print(" Set Engine: "..engine_set, 10, 10)
love.graphics.print(" Current Speed: "..engine_cur, 10, 20)
love.graphics.print("Orientation/deg: "..orient_deg, 10, 30)
love.graphics.print(" i : "..i, 10, 40)
love.graphics.setColor(0, 255, 0, 255) -- < That makes entire window green transparent?
love.graphics.rectangle("fill", btn.x, btn.y, btn.w, btn.h)
end
Why has my code gone ill?