|
|
@ -17,8 +17,8 @@ namespace TheGameExtreme.view
|
|
|
|
Dictionary<long, TouchManipulationInfo> touchDictionary = new Dictionary<long, TouchManipulationInfo>();
|
|
|
|
Dictionary<long, TouchManipulationInfo> touchDictionary = new Dictionary<long, TouchManipulationInfo>();
|
|
|
|
public CardVM Value;
|
|
|
|
public CardVM Value;
|
|
|
|
public string display;
|
|
|
|
public string display;
|
|
|
|
private float width = 0.01f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
private float width = 0.02f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
private float height = 0.01f * (float)DeviceDisplay.MainDisplayInfo.Width * 3f;
|
|
|
|
private float height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -30,16 +30,17 @@ namespace TheGameExtreme.view
|
|
|
|
this.textPaint = textPaint;
|
|
|
|
this.textPaint = textPaint;
|
|
|
|
Value = value;
|
|
|
|
Value = value;
|
|
|
|
display = Value.ToString();
|
|
|
|
display = Value.ToString();
|
|
|
|
|
|
|
|
height = 2f * width;
|
|
|
|
|
|
|
|
|
|
|
|
if (!display.Contains(",") && !display.Contains(".") && !display.Contains("/"))
|
|
|
|
if (!display.Contains(",") && !display.Contains(".") && !display.Contains("/"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (decimal.Parse(display) < 0 && decimal.Parse(display) > -10)
|
|
|
|
if (decimal.Parse(display) <= -10)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
display = "-0" + Math.Abs(decimal.Parse(display)).ToString();
|
|
|
|
width -= textPaint.MeasureText("0") * 0.5f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (decimal.Parse(display) >= 0 && decimal.Parse(display) < 10)
|
|
|
|
else if (decimal.Parse(display) >= 0 && decimal.Parse(display) < 10)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
display = "0" + display;
|
|
|
|
width += textPaint.MeasureText("0") * 0.5f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -70,13 +71,11 @@ namespace TheGameExtreme.view
|
|
|
|
textPaint.StrokeWidth = 5;
|
|
|
|
textPaint.StrokeWidth = 5;
|
|
|
|
textPaint.Style = SKPaintStyle.Stroke;
|
|
|
|
textPaint.Style = SKPaintStyle.Stroke;
|
|
|
|
|
|
|
|
|
|
|
|
SKRect textBounds = new SKRect();
|
|
|
|
SKRect card = new SKRect();
|
|
|
|
textPaint.MeasureText(display, ref textBounds);
|
|
|
|
textPaint.MeasureText(display, ref card);
|
|
|
|
|
|
|
|
|
|
|
|
SKRoundRect card = new SKRoundRect(textBounds, 1f, 1f);
|
|
|
|
|
|
|
|
card.Inflate(width, height);
|
|
|
|
card.Inflate(width, height);
|
|
|
|
|
|
|
|
|
|
|
|
canvas.DrawRoundRect(card, textPaint);
|
|
|
|
canvas.DrawRect(card, textPaint);
|
|
|
|
canvas.DrawText(display, 0, 0, textPaint);
|
|
|
|
canvas.DrawText(display, 0, 0, textPaint);
|
|
|
|
|
|
|
|
|
|
|
|
canvas.Restore();
|
|
|
|
canvas.Restore();
|
|
|
|