|
|
|
@ -8,6 +8,7 @@ using SkiaSharp.Views.Forms;
|
|
|
|
|
using TouchTracking;
|
|
|
|
|
using Xamarin.Essentials;
|
|
|
|
|
using TheGameExtreme.Resx;
|
|
|
|
|
using TheGameExtreme.model.card.cardType;
|
|
|
|
|
|
|
|
|
|
namespace TheGameExtreme.view
|
|
|
|
|
{
|
|
|
|
@ -195,17 +196,9 @@ namespace TheGameExtreme.view
|
|
|
|
|
stackCollection.Clear();
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if (indexMode == 4 || indexMode == 3)
|
|
|
|
|
{
|
|
|
|
|
inflateWidth = 0.03f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
inflateWidth = 0.02f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
|
}
|
|
|
|
|
float inflateWidth = 0.024f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20);
|
|
|
|
|
|
|
|
|
|
position.X -= inflateWidth;
|
|
|
|
|
|
|
|
|
@ -214,21 +207,16 @@ namespace TheGameExtreme.view
|
|
|
|
|
textPaint = new SKPaint();
|
|
|
|
|
float textWidth;
|
|
|
|
|
|
|
|
|
|
if (indexMode == 3)
|
|
|
|
|
if (viewmodel.getListOrderedStacks()[i].Peek().View.GetType() == typeof(FractionCard))
|
|
|
|
|
{
|
|
|
|
|
textWidth = textPaint.MeasureText("000");
|
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("000");
|
|
|
|
|
}
|
|
|
|
|
else if (indexMode == 4)
|
|
|
|
|
{
|
|
|
|
|
textWidth = textPaint.MeasureText("0000");
|
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
|
|
|
|
|
string displayMax = Math.Pow(10, ((FractionCard)(viewmodel.getListOrderedStacks()[i].Peek().View)).Fraction.SizeMax-1).ToString();
|
|
|
|
|
textWidth = textPaint.MeasureText(displayMax);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
textWidth = textPaint.MeasureText("00");
|
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
|
}
|
|
|
|
|
textPaint.TextSize = 0.03f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
|
position.X -= textWidth * 0.5f;
|
|
|
|
|
|
|
|
|
|
stackCollection.Add(new TouchManipulationCard(textPaint, viewmodel.getListOrderedStacks()[i].Peek(), inflateWidth)
|
|
|
|
@ -238,7 +226,7 @@ namespace TheGameExtreme.view
|
|
|
|
|
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,17 +237,9 @@ namespace TheGameExtreme.view
|
|
|
|
|
private void InflateHand()
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
if (indexMode == 4 || indexMode == 3)
|
|
|
|
|
{
|
|
|
|
|
inflateWidth = 0.03f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
inflateWidth = 0.015f * (float)DeviceDisplay.MainDisplayInfo.Width;
|
|
|
|
|
}
|
|
|
|
|
float inflateWidth = 0.024f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20);
|
|
|
|
|
|
|
|
|
|
position.X -= inflateWidth;
|
|
|
|
|
|
|
|
|
@ -268,23 +248,18 @@ namespace TheGameExtreme.view
|
|
|
|
|
textPaint = new SKPaint();
|
|
|
|
|
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");
|
|
|
|
|
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
|
|
|
|
|
string displayMax = Math.Pow(10, ((FractionCard)(viewmodel.CurrentHand[i].View)).Fraction.SizeMax-1).ToString();
|
|
|
|
|
textWidth = textPaint.MeasureText(displayMax);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
textWidth = textPaint.MeasureText("00");
|
|
|
|
|
textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
|
}
|
|
|
|
|
textPaint.TextSize = 0.03f * (float)(DeviceDisplay.MainDisplayInfo.Width - 20) * textPaint.TextSize / textPaint.MeasureText("00");
|
|
|
|
|
position.X -= textWidth * 0.5f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textCollection.Add(new TouchManipulationCard(textPaint, viewmodel.CurrentHand[i], inflateWidth)
|
|
|
|
|
{
|
|
|
|
|
Matrix = SKMatrix.MakeTranslation(position.X, position.Y),
|
|
|
|
@ -292,7 +267,7 @@ namespace TheGameExtreme.view
|
|
|
|
|
InitialPoint = position
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
position.X += (float)((DeviceDisplay.MainDisplayInfo.Width) / viewmodel.CurrentHand.Count);
|
|
|
|
|
position.X += (float)((DeviceDisplay.MainDisplayInfo.Width - 20) / viewmodel.CurrentHand.Count) + textWidth * 0.5f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|