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: 36
Joined: Fri Jan 20, 2017 5:51 pm

i am looking for an example to make a text blink

Post by Bernard51 » Sun Aug 12, 2018 8:02 pm

Hello

I am looking for an example to make a text blink thanks in advance

User avatar
zorg
Party member
Posts: 2325
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 » Sun Aug 12, 2018 8:10 pm

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: 36
Joined: Fri Jan 20, 2017 5:51 pm

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

Post by Bernard51 » Sun Aug 12, 2018 8:27 pm

sorry i did not understand anything

User avatar
steVeRoll
Citizen
Posts: 74
Joined: Sun Feb 14, 2016 1:13 pm

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

Post by steVeRoll » Sun Aug 12, 2018 9:30 pm

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: 36
Joined: Fri Jan 20, 2017 5:51 pm

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

Post by Bernard51 » Mon Aug 13, 2018 5:11 am

Thank you steVeRoll

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests