Projekt přejmenován. Neko nastaven na výchozí pozici
This commit is contained in:
parent
1a27dd6fab
commit
ceac37920b
104 changed files with 873 additions and 208 deletions
31
ONDClient/GUI/TimerUIElement.cs
Normal file
31
ONDClient/GUI/TimerUIElement.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace ONDClient.GUI;
|
||||
|
||||
public class TimerUIElement : TextUIElement{
|
||||
private Stopwatch stopwatch = new();
|
||||
|
||||
|
||||
public TimerUIElement(Point corner1, SpriteFont font) : base(corner1, font) {
|
||||
Text = "00:00.000";
|
||||
Bounds = (corner1, corner1 + new Point((int)Measure().X, (int)Measure().Y));
|
||||
}
|
||||
|
||||
public override void Update() {
|
||||
if (stopwatch.IsRunning){
|
||||
Text = stopwatch.Elapsed.ToString("mm\\:ss\\.fff");
|
||||
// Text = stopwatch.ElapsedMilliseconds.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public void Start() {
|
||||
stopwatch.Restart();
|
||||
}
|
||||
|
||||
public void Stop() {
|
||||
stopwatch.Stop();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue