## intensity of printing

General discussion about LÖVE, Lua, game development, puns, and unicorns.
randy0428
Citizen
Posts: 51
Joined: Sun Jul 31, 2016 10:19 am

### intensity of printing

While experimenting I accidently printed two nearly identical strings ("test1" and "test2") in the same location. When I corrected this, it seemed as though the text of the two separate strings was not as intense/bright as when they overlapped. So I did a test. I printed the "test1" string 4 times at the same location and the "test2" sting just once below it. The string that is printed 4 times at the same location is clearly more intense/brighter.

Is there a way to get this brighter effect without printing multiple times?
Attachments
intensity.png (5.87 KiB) Viewed 1039 times

pgimeno
Party member
Posts: 1635
Joined: Sun Oct 18, 2015 2:58 pm

### Re: intensity of printing

With a shader, you can modulate the alpha. The effect shouldn't be very different.

Code: Select all

local shader = love.graphics.newShader[[
extern number gamma;
vec4 effect(vec4 colour, Image texture, vec2 texpos, vec2 scrpos)
{
return colour * vec4(Texel(texture, texpos).rgb, pow(Texel(texture, texpos).a, gamma));
}
]]

function love.draw(txt)
love.graphics.print("test1")
love.graphics.print("test2", 0, 40)
end

You could also use a different font, e.g. one with boldface, or create a bitmap font.

randy0428
Citizen
Posts: 51
Joined: Sun Jul 31, 2016 10:19 am

### Re: intensity of printing

Thanks pgimento.
Your reply is a bit over my head at my current level of knowledge of löve. At this time this is not a terribly important thing for me. Perhaps sometime in the future I'll revisit this topic and learn about shaders.

NobodysSon
Prole
Posts: 28
Joined: Tue Oct 30, 2012 10:37 pm

### Re: intensity of printing

I'm curious as why the line with multiple reprintings is more intense. Are multiple alpha levels being combined or what?

zorg
Party member
Posts: 2602
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: intensity of printing

NobodysSon wrote:
Thu Jan 03, 2019 3:54 am
I'm curious as why the line with multiple reprintings is more intense. Are multiple alpha levels being combined or what?
That's exactly what's happening.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

### Who is online

Users browsing this forum: Bing [Bot] and 8 guests