how to make a text flash?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Bernard51
Prole
Posts: 46
Joined: Fri Jan 20, 2017 5:51 pm

how to make a text flash?

Post by Bernard51 »

Hello

I am trying to do for my text blink thanks
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: how to make a text flash?

Post by grump »

Simple ad hoc idea:

Code: Select all

local speed = 2

function love.draw()
	local a = math.abs(math.cos(love.timer.getTime() * speed % 2 * math.pi))
	love.graphics.setColor(1, 1, 1, a)
	love.graphics.print("Blink.")
end
Bernard51
Prole
Posts: 46
Joined: Fri Jan 20, 2017 5:51 pm

Re: how to make a text flash?

Post by Bernard51 »

Thank you
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 10 guests