Renderování textu, jumpscary, win a lose screen
This commit is contained in:
parent
9bfe63a166
commit
e6128dc9f5
21 changed files with 360 additions and 84 deletions
30
FNAF_Clone/GUI/TimerUIElement.cs
Normal file
30
FNAF_Clone/GUI/TimerUIElement.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace FNAF_Clone.GUI;
|
||||
|
||||
public class TimerUIElement : TextUIElement{
|
||||
private Stopwatch stopwatch = new();
|
||||
|
||||
|
||||
public TimerUIElement(Point corner1, SpriteFont font) : base(corner1, font) {
|
||||
Text = "00:00.000";
|
||||
}
|
||||
|
||||
public override void Update() {
|
||||
if (stopwatch.IsRunning){
|
||||
Text = stopwatch.Elapsed.ToString("mm\\:ss\\.fff");
|
||||
// Text = stopwatch.ElapsedMilliseconds.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public void Start() {
|
||||
stopwatch.Start();
|
||||
}
|
||||
|
||||
public void Stop() {
|
||||
stopwatch.Stop();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue