|
|
@ -8,6 +8,7 @@ using SkiaSharp.Views.Forms;
|
|
|
|
using TouchTracking;
|
|
|
|
using TouchTracking;
|
|
|
|
using Xamarin.Essentials;
|
|
|
|
using Xamarin.Essentials;
|
|
|
|
using TheGameExtreme.Resx;
|
|
|
|
using TheGameExtreme.Resx;
|
|
|
|
|
|
|
|
using TheGameExtreme.model.card.cardType;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TheGameExtreme.view
|
|
|
|
namespace TheGameExtreme.view
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -195,16 +196,16 @@ namespace TheGameExtreme.view
|
|
|
|
stackCollection.Clear();
|
|
|
|
stackCollection.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
SKPaint textPaint = new SKPaint();
|
|
|
|
SKPaint textPaint = new SKPaint();
|
|
|
|
SKPoint position = new SKPoint((float)((DeviceDisplay.MainDisplayInfo.Width) / (viewmodel.getListOrderedStacks().Count * 2)), (float)((DeviceDisplay.MainDisplayInfo.Height * 0.1) + (DeviceDisplay.MainDisplayInfo.Height * 0.9) * 0.01 + 2 * (0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("001"))));
|
|
|
|
SKPoint position = new SKPoint((float)((DeviceDisplay.MainDisplayInfo.Width - 20) / (viewmodel.getListOrderedStacks().Count * 2)) + 10f, (float)((DeviceDisplay.MainDisplayInfo.Height * 0.1) + (DeviceDisplay.MainDisplayInfo.Height * 0.9) * 0.01 + 2 * (0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("001"))));
|
|
|
|
|
|
|
|
|
|
|
|
float inflateWidth;
|
|
|
|
float inflateWidth;
|
|
|
|
if (indexMode == 4 || indexMode == 3)
|
|
|
|
if (indexMode == 4 || indexMode == 3)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inflateWidth = 0.03f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
inflateWidth = 0.03f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inflateWidth = 0.02f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
inflateWidth = 0.02f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
position.X -= inflateWidth;
|
|
|
|
position.X -= inflateWidth;
|
|
|
@ -214,20 +215,16 @@ namespace TheGameExtreme.view
|
|
|
|
textPaint = new SKPaint();
|
|
|
|
textPaint = new SKPaint();
|
|
|
|
float textWidth;
|
|
|
|
float textWidth;
|
|
|
|
|
|
|
|
|
|
|
|
if (indexMode == 3)
|
|
|
|
if (viewmodel.getListOrderedStacks()[i].Peek().View.GetType() == typeof(FractionCard))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
textWidth = textPaint.MeasureText("000");
|
|
|
|
string displayMax = Math.Pow(10, ((FractionCard)(viewmodel.getListOrderedStacks()[i].Peek().View)).Fraction.SizeMax-1).ToString();
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("000");
|
|
|
|
textWidth = textPaint.MeasureText(displayMax);
|
|
|
|
}
|
|
|
|
textPaint.TextSize = 0.048f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText(displayMax);
|
|
|
|
else if (indexMode == 4)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
textWidth = textPaint.MeasureText("0000");
|
|
|
|
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
textWidth = textPaint.MeasureText("00");
|
|
|
|
textWidth = textPaint.MeasureText("00");
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
textPaint.TextSize = 0.04f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
position.X -= textWidth * 0.5f;
|
|
|
|
position.X -= textWidth * 0.5f;
|
|
|
|
|
|
|
|
|
|
|
@ -238,7 +235,7 @@ namespace TheGameExtreme.view
|
|
|
|
InitialPoint = position
|
|
|
|
InitialPoint = position
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
position.X += (float)((DeviceDisplay.MainDisplayInfo.Width) / viewmodel.getListOrderedStacks().Count);
|
|
|
|
position.X += (float)((DeviceDisplay.MainDisplayInfo.Width - 20) / viewmodel.getListOrderedStacks().Count) + textWidth * 0.5f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -249,16 +246,16 @@ namespace TheGameExtreme.view
|
|
|
|
private void InflateHand()
|
|
|
|
private void InflateHand()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SKPaint textPaint = new SKPaint();
|
|
|
|
SKPaint textPaint = new SKPaint();
|
|
|
|
SKPoint position = new SKPoint((float)((DeviceDisplay.MainDisplayInfo.Width) / (viewmodel.CurrentHand.Count * 2)), (float)((DeviceDisplay.MainDisplayInfo.Height * 0.9) - (DeviceDisplay.MainDisplayInfo.Height * 0.9) * 0.1 - 2 * (0.05f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("001"))));
|
|
|
|
SKPoint position = new SKPoint((float)((DeviceDisplay.MainDisplayInfo.Width - 20) / (viewmodel.CurrentHand.Count * 2)) + 10f, (float)((DeviceDisplay.MainDisplayInfo.Height * 0.9) - (DeviceDisplay.MainDisplayInfo.Height * 0.9) * 0.1 - 2 * (0.05f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText("001"))));
|
|
|
|
|
|
|
|
|
|
|
|
float inflateWidth;
|
|
|
|
float inflateWidth;
|
|
|
|
if (indexMode == 4 || indexMode == 3)
|
|
|
|
if (indexMode == 4 || indexMode == 3)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inflateWidth = 0.03f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
inflateWidth = 0.03f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inflateWidth = 0.015f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
inflateWidth = 0.015f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
position.X -= inflateWidth;
|
|
|
|
position.X -= inflateWidth;
|
|
|
@ -268,20 +265,16 @@ namespace TheGameExtreme.view
|
|
|
|
textPaint = new SKPaint();
|
|
|
|
textPaint = new SKPaint();
|
|
|
|
float textWidth;
|
|
|
|
float textWidth;
|
|
|
|
|
|
|
|
|
|
|
|
if (indexMode == 3)
|
|
|
|
if (viewmodel.CurrentHand[i].View.GetType() == typeof(FractionCard))
|
|
|
|
{
|
|
|
|
|
|
|
|
textWidth = textPaint.MeasureText("000");
|
|
|
|
|
|
|
|
textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("000");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (indexMode == 4)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
textWidth = textPaint.MeasureText("0000");
|
|
|
|
string displayMax = Math.Pow(10, ((FractionCard)(viewmodel.CurrentHand[i].View)).Fraction.SizeMax-1).ToString();
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
|
|
|
|
textWidth = textPaint.MeasureText(displayMax);
|
|
|
|
|
|
|
|
textPaint.TextSize = 0.048f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText(displayMax);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
textWidth = textPaint.MeasureText("00");
|
|
|
|
textWidth = textPaint.MeasureText("00");
|
|
|
|
textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
textPaint.TextSize = 0.048f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
position.X -= textWidth * 0.5f;
|
|
|
|
position.X -= textWidth * 0.5f;
|
|
|
|
|
|
|
|
|
|
|
@ -292,7 +285,7 @@ namespace TheGameExtreme.view
|
|
|
|
InitialPoint = position
|
|
|
|
InitialPoint = position
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
position.X += (float)((DeviceDisplay.MainDisplayInfo.Width) / viewmodel.CurrentHand.Count);
|
|
|
|
position.X += (float)((DeviceDisplay.MainDisplayInfo.Width - 20) / viewmodel.CurrentHand.Count) + textWidth * 0.5f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|