Ui-Info-Suite/SDVModTest/UIElements/ExperiencePointDisplay.cs

56 lines
1.6 KiB
C#
Raw Permalink Normal View History

2017-07-20 11:51:05 +08:00
using Microsoft.Xna.Framework;
2020-02-20 11:39:13 +08:00
using StardewModdingAPI;
2017-07-20 11:51:05 +08:00
using StardewValley;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UIInfoSuite.UIElements
{
class ExperiencePointDisplay
{
private int _alpha = 100;
private float _experiencePoints;
private Vector2 _position;
public ExperiencePointDisplay(float experiencePoints, Vector2 position)
{
_position = position;
_experiencePoints = experiencePoints;
}
public void Draw()
{
_position.Y -= 0.5f;
--_alpha;
2020-02-20 11:39:13 +08:00
if(Constants.TargetPlatform == GamePlatform.Android)
{
Game1.drawWithBorder(
"Exp " + _experiencePoints,
Color.DarkSlateGray * ((float)_alpha / 100f),
Color.PaleTurquoise * ((float)_alpha / 100f),
new Vector2(_position.X - 28, _position.Y - 130) * Game1.options.zoomLevel,
0.0f,
0.8f,
0.0f);
return;
}
2017-07-20 11:51:05 +08:00
Game1.drawWithBorder(
"Exp " + _experiencePoints,
Color.DarkSlateGray * ((float)_alpha / 100f),
Color.PaleTurquoise * ((float)_alpha / 100f),
new Vector2(_position.X - 28, _position.Y - 130),
0.0f,
0.8f,
0.0f);
}
public bool IsInvisible
{
get { return _alpha < 3; }
}
}
}