SkinRenderer - Add 'HighlightlingColor' property

This commit is contained in:
miku-666
2024-05-18 18:21:57 +02:00
parent c73625f9ae
commit 71ff037887
2 changed files with 7 additions and 2 deletions

View File

@@ -255,6 +255,7 @@ namespace PckStudio.Forms.Editor
}
}
// TODO: fixed outline rendering
private void skinPartListBox_SelectedIndexChanged(object sender, EventArgs e)
{
int scale = 4;
@@ -269,7 +270,7 @@ namespace PckStudio.Forms.Editor
GraphicsPath graphicsPath = box.GetUVGraphicsPath(new System.Numerics.Vector2(scaleSize.Width * renderer3D1.TillingFactor.X, scaleSize.Height * renderer3D1.TillingFactor.Y));
g.ApplyConfig(_graphicsConfig);
g.DrawImage(_skin.Model.Texture, new Rectangle(Point.Empty, scaleSize), new Rectangle(Point.Empty, _skin.Model.Texture.Size), GraphicsUnit.Pixel);
g.DrawPath(new Pen(renderer3D1.GuideLineColor, lineWidth), graphicsPath);
g.DrawPath(new Pen(renderer3D1.HighlightlingColor, lineWidth), graphicsPath);
}
uvPictureBox.Invalidate();
}

View File

@@ -82,6 +82,10 @@ namespace PckStudio.Rendering
[Category("Appearance")]
public Color GuideLineColor { get; set; }
[Description("The Color used for highlighting selected cube")]
[Category("Appearance")]
public Color HighlightlingColor { get; set; } = Color.Aqua;
public float MouseSensetivity { get; set; } = 0.01f;
public int SelectedIndex
{
@@ -1181,7 +1185,7 @@ namespace PckStudio.Rendering
Vector3 pivot = cubeMesh.Pivot + cubeMesh.Offset;
transform = Pivot(translation, pivot, transform);
GL.BlendFunc(BlendingFactor.DstAlpha, BlendingFactor.OneMinusSrcAlpha);
DrawBoundingBox(transform, cubeBoundingBox, GuideLineColor);
DrawBoundingBox(transform, cubeBoundingBox, HighlightlingColor);
GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
}
}