Is there a way to change font color?
Is there a way to change font color?
i wanted to change the color of the font displayed. Because i loaded a white background image and i decided to trace the mouseX and mouseY, but since text is is white, i cannot see properly. So is there anyway to change the font color. thanks.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Is there a way to change font color?
Everything is drawn using the foreground color, so use love.graphics.setColor.
Re: Is there a way to change font color?
i try using set color and this make my whole game screen black which covers the image. This is what i typed
and
Code: Select all
mouseX = love.mouse.getX()
mouseY = love.mouse.getY()
love.graphics.setColor(0,0,0,255)
love.graphics.draw(menu,0,0)
love.graphics.setFont(50)
love.graphics.print("X: "..mouseX, 100, 100)
love.graphics.print("Y: "..mouseY, 400, 100)
Code: Select all
mouseX = love.mouse.getX()
mouseY = love.mouse.getY()
love.graphics.setColor(255,255,255,255)
love.graphics.draw(menu,0,0)
love.graphics.setFont(50)
love.graphics.print("X: "..mouseX, 100, 100)
love.graphics.print("Y: "..mouseY, 400, 100)
Code: Select all
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Is there a way to change font color?
setColor colors the images as well, oh and stop using setFont(<size>) in love.draw, it creates a font every single frame.
Re: Is there a way to change font color?
okay. thanks.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Is there a way to change font color?
Unless you change colormode from modulate to replace.bartbes wrote:setColor colors the images as well
Who is online
Users browsing this forum: No registered users and 2 guests