i am looking for an example to make a text blink

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Bernard51
Prole
Posts: 46
Joined: Fri Jan 20, 2017 5:51 pm

i am looking for an example to make a text blink

Post by Bernard51 »

Hello

I am looking for an example to make a text blink thanks in advance
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: i am looking for an example to make a text blink

Post by zorg »

use a timer, if some time elapsed, flip a boolean variable; if it's false, do nothing (or draw your text in the "off" state, different color or whatever), if it's true, draw your text "normally".
Me and my stuff :3True 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.
Bernard51
Prole
Posts: 46
Joined: Fri Jan 20, 2017 5:51 pm

Re: i am looking for an example to make a text blink

Post by Bernard51 »

sorry i did not understand anything
User avatar
steVeRoll
Party member
Posts: 131
Joined: Sun Feb 14, 2016 1:13 pm

Re: i am looking for an example to make a text blink

Post by steVeRoll »

I guess you could do something like this:

Code: Select all

function love.draw()
  if math.floor(love.timer.getTime()) % 2 == 0 then
    love.graphics.print("Your text here")
  end
end
Bernard51
Prole
Posts: 46
Joined: Fri Jan 20, 2017 5:51 pm

Re: i am looking for an example to make a text blink

Post by Bernard51 »

Thank you steVeRoll
Post Reply

Who is online

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