First attempt with smaller glyph textures

Some CText and SColor improvements
This commit is contained in:
Flamefire committed 2013-04-30 15:12:36 +02:00
1 parent d239492f19
commit e602f55bb4
8 files changed
+229 -131

No files matched your search

+3 -3
View File
@@ -312,7 +312,7 @@ namespace VocaluxeLib.Menu
if (_Reflection)
{
CBase.Drawing.DrawTextureReflection(texture, Rect, Color, Rect, _ReflectionSpace, _ReflectionHeight);
Text.DrawRelative(Rect.X, Rect.Y, _ReflectionSpace, _ReflectionHeight, Rect.H);
Text.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H);
}
else
Text.DrawRelative(Rect.X, Rect.Y);
@@ -326,7 +326,7 @@ namespace VocaluxeLib.Menu
if (_Reflection)
{
CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, Rect, _ReflectionSpace, _ReflectionHeight);
Text.DrawRelative(Rect.X, Rect.Y, _ReflectionSpace, _ReflectionHeight, Rect.H);
Text.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H);
}
else
Text.DrawRelative(Rect.X, Rect.Y);
@@ -340,7 +340,7 @@ namespace VocaluxeLib.Menu
if (_Reflection)
{
CBase.Drawing.DrawTextureReflection(texture, Rect, SelColor, Rect, _ReflectionSpace, _ReflectionHeight);
_SelText.DrawRelative(Rect.X, Rect.Y, _ReflectionSpace, _ReflectionHeight, Rect.H);
_SelText.DrawRelative(Rect.X, Rect.Y, _ReflectionHeight, _ReflectionSpace, Rect.H);
}
else
_SelText.DrawRelative(Rect.X, Rect.Y);
+4 -14
View File
@@ -697,12 +697,7 @@ namespace VocaluxeLib.Menu
CBase.Drawing.DrawColor(new SColorF(0.5f, 1f, 0.5f, 0.5f), new SRectF(x, Y, bounds.Width, bounds.Height, Z));
}
public void DrawRelative(float x, float y, float reflectionSpace, float reflectionHeigth, float rectHeight)
{
DrawRelative(x, y, true, reflectionSpace, reflectionHeigth, rectHeight);
}
public void DrawRelative(float rx, float ry, bool reflection = false, float reflectionSpace = 0f, float reflectionHeight = 0f, float rectHeight = 0f)
public void DrawRelative(float rx, float ry, float reflectionHeight = 0f, float reflectionSpace = 0f, float rectHeight = 0f)
{
// Update Text
Text = Text;
@@ -724,14 +719,11 @@ namespace VocaluxeLib.Menu
h *= factor;
switch (HAlign)
{
case EHAlignment.Top:
y += step * 0.25f;
break;
case EHAlignment.Center:
y += step * 0.50f;
break;
case EHAlignment.Bottom:
y += step * 0.75f;
y += step;
break;
}
@@ -749,9 +741,7 @@ namespace VocaluxeLib.Menu
}
SColorF currentColor = new SColorF(Color);
if (Selected)
currentColor = new SColorF(SelColor);
SColorF currentColor = (Selected) ? SelColor : Color;
SColorF color = new SColorF(currentColor.R, currentColor.G, currentColor.B, currentColor.A * Alpha);
@@ -760,7 +750,7 @@ namespace VocaluxeLib.Menu
CBase.Fonts.DrawText(_Text, h, x, y, Z, color);
if (reflection)
if (reflectionHeight > 0)
{
float space = (rectHeight - Y - bounds.Height) * 2f + reflectionSpace;
float height = reflectionHeight - (rectHeight - Y) + bounds.Height;
+6
View File
@@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using VocaluxeLib.Menu.SingNotes;
@@ -48,6 +49,11 @@ namespace VocaluxeLib.Menu
B = color.B;
A = color.A;
}
public Color AsColor()
{
return Color.FromArgb((int)(A * 255), (int)(R * 255), (int)(G * 255), (int)(B * 255));
}
}
public struct SRectF