25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
-
- namespace RenderHookAPI.Hook
- {
- public class TextDisplay
- {
- long _startTickCount = 0;
-
- public TextDisplay()
- {
- _startTickCount = DateTime.Now.Ticks;
- Display = true;
- }
-
- /// <summary>
- /// Must be called each frame
- /// </summary>
- public void Frame()
- {
- if (Display && Math.Abs(DateTime.Now.Ticks - _startTickCount) > Duration.Ticks)
- {
- Display = false;
- }
- }
-
- public bool Display { get; set; }
- public String Text { get; set; }
- public TimeSpan Duration { get; set; }
- public float Remaining
- {
- get
- {
- if (Display)
- {
- return (float)Math.Abs(DateTime.Now.Ticks - _startTickCount) / (float)Duration.Ticks;
- }
- else
- {
- return 0;
- }
- }
- }
- }
- }
|