Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
How to display a digital clock on SFML window?
Print
Pages: [
1
]
Author
Topic: How to display a digital clock on SFML window? (Read 5703 times)
0 Members and 1 Guest are viewing this topic.
ngocdung93
Newbie
Posts: 6
How to display a digital clock on SFML window?
«
on:
December 05, 2013, 08:07:45 pm »
Can you help me with displaying a digital clock? With both minute and second please.
Logged
Raincode
Full Member
Posts: 118
Re: How to display a digital clock on SFML window?
«
Reply #1 on:
December 05, 2013, 08:59:46 pm »
My first attempt would be time(0) from ctime and sf::Text
Logged
maidis
Newbie
Posts: 8
Re: How to display a digital clock on SFML window?
«
Reply #2 on:
December 05, 2013, 10:29:30 pm »
Probably not the best way to create clock with SFML but at least it'll give you an idea and a working example
Here is example code [1] which mostly based on this analog clock [2]. And here is digital clock's screenshot [3]. Also I give a try to do a binary clock similar to this [4].
Edit:
There is already a binary clock written with SFML [5].
[1]
http://pastebin.kde.org/pee140834
[2]
https://github.com/SFML/SFML/wiki/Source%3A-Analog-Clock
[3]
[4]
[5]
https://github.com/Gjum/BinClock
«
Last Edit: December 05, 2013, 11:44:22 pm by maidis
»
Logged
ngocdung93
Newbie
Posts: 6
Re: How to display a digital clock on SFML window?
«
Reply #3 on:
December 06, 2013, 02:56:16 am »
thanks u very much. i'll give it a try
Logged
ngocdung93
Newbie
Posts: 6
Re: How to display a digital clock on SFML window?
«
Reply #4 on:
December 06, 2013, 03:43:32 am »
if i have a texture and a clock, how could i bring the clock to the front? the texture is always in front of it and i can't see the clock
Logged
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
Re: How to display a digital clock on SFML window?
«
Reply #5 on:
December 06, 2013, 08:17:19 am »
Draw the clock after the texture?
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
ngocdung93
Newbie
Posts: 6
Re: How to display a digital clock on SFML window?
«
Reply #6 on:
December 06, 2013, 11:29:18 am »
ok i got it.thanks you all.
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
How to display a digital clock on SFML window?
anything