Removed unused and temporary stuff
This commit is contained in:
1 parent
7aa83f0f43
commit
553be47783
14 files changed
+26
-122
No files matched your search
@@ -103,16 +103,6 @@ namespace Vocaluxe.Base
|
|||||||
return _Draw.GetScreenHeight();
|
return _Draw.GetScreenHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RectangleF GetTextBounds(CText text)
|
|
||||||
{
|
|
||||||
return _Draw.GetTextBounds(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RectangleF GetTextBounds(CText text, float height)
|
|
||||||
{
|
|
||||||
return _Draw.GetTextBounds(text, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2)
|
public static void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2)
|
||||||
{
|
{
|
||||||
_Draw.DrawLine(a, r, g, b, w, x1, y1, x2, y2);
|
_Draw.DrawLine(a, r, g, b, w, x1, y1, x2, y2);
|
||||||
@@ -159,12 +149,6 @@ namespace Vocaluxe.Base
|
|||||||
_Draw.MakeScreenShot();
|
_Draw.MakeScreenShot();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw Basic Text (must be deleted later)
|
|
||||||
public static void DrawText(string text, int x, int y, int h)
|
|
||||||
{
|
|
||||||
_Draw.DrawText(text, x, y, h);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static STexture AddTexture(Bitmap bitmap)
|
public static STexture AddTexture(Bitmap bitmap)
|
||||||
{
|
{
|
||||||
return _Draw.AddTexture(bitmap);
|
return _Draw.AddTexture(bitmap);
|
||||||
|
|||||||
@@ -340,11 +340,6 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
class CBdraw : IDrawing
|
class CBdraw : IDrawing
|
||||||
{
|
{
|
||||||
public RectangleF GetTextBounds(CText text)
|
|
||||||
{
|
|
||||||
return CDraw.GetTextBounds(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DrawTexture(STexture texture, SRectF rect)
|
public void DrawTexture(STexture texture, SRectF rect)
|
||||||
{
|
{
|
||||||
CDraw.DrawTexture(texture, rect);
|
CDraw.DrawTexture(texture, rect);
|
||||||
@@ -429,6 +424,11 @@ namespace Vocaluxe.Base
|
|||||||
CFonts.Style = fontStyle;
|
CFonts.Style = fontStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RectangleF GetTextBounds(CText text)
|
||||||
|
{
|
||||||
|
return CFonts.GetTextBounds(text);
|
||||||
|
}
|
||||||
|
|
||||||
public RectangleF GetTextBounds(CText text, float textHeight)
|
public RectangleF GetTextBounds(CText text, float textHeight)
|
||||||
{
|
{
|
||||||
return CFonts.GetTextBounds(text, textHeight);
|
return CFonts.GetTextBounds(text, textHeight);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using SlimDX.Windows;
|
using SlimDX.Windows;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Base.Fonts;
|
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Draw
|
namespace Vocaluxe.Lib.Draw
|
||||||
@@ -620,30 +619,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return _Device.Viewport.Height;
|
return _Device.Viewport.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calculates the bounds for a CText object
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="text">The CText object of which the bounds should be calculated for</param>
|
|
||||||
/// <returns>RectangleF object containing the bounds</returns>
|
|
||||||
public RectangleF GetTextBounds(CText text)
|
|
||||||
{
|
|
||||||
return GetTextBounds(text, text.Height);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calculates the bounds for a CText object
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="text">The CText object of which the bounds should be calculated for</param>
|
|
||||||
/// <param name="height">The height of the CText object</param>
|
|
||||||
/// <returns>RectangleF object containing the bounds</returns>
|
|
||||||
public RectangleF GetTextBounds(CText text, float height)
|
|
||||||
{
|
|
||||||
CFonts.Height = height;
|
|
||||||
CFonts.SetFont(text.Font);
|
|
||||||
CFonts.Style = text.Style;
|
|
||||||
return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a quad a list which will be added and rendered to the vertexbuffer when calling RenderToVertexBuffer to reduce vertexbuffer calls each frame to a minimum
|
/// Adds a quad a list which will be added and rendered to the vertexbuffer when calling RenderToVertexBuffer to reduce vertexbuffer calls each frame to a minimum
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -795,19 +770,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
DrawTexture(_BlankTexture, new SRectF(x1, y1, x2, y2, 1), color);
|
DrawTexture(_BlankTexture, new SRectF(x1, y1, x2, y2, 1), color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Draws a text string
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="text">The text to be drawn</param>
|
|
||||||
/// <param name="x">The text's x-position</param>
|
|
||||||
/// <param name="y">The text's y-position</param>
|
|
||||||
/// <param name="h">The text's height</param>
|
|
||||||
/// <param name="z">The text's z-position</param>
|
|
||||||
public void DrawText(string text, int x, int y, int h, int z = 0)
|
|
||||||
{
|
|
||||||
CFonts.DrawText(text, h, x, y, z, new SColorF(1f, 1f, 1f, 1f));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws a colored rectangle
|
/// Draws a colored rectangle
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Base.Fonts;
|
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Draw
|
namespace Vocaluxe.Lib.Draw
|
||||||
@@ -286,19 +285,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return ClientSize.Height;
|
return ClientSize.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RectangleF GetTextBounds(CText text)
|
|
||||||
{
|
|
||||||
return GetTextBounds(text, text.Height);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RectangleF GetTextBounds(CText text, float height)
|
|
||||||
{
|
|
||||||
CFonts.Height = height;
|
|
||||||
CFonts.SetFont(text.Font);
|
|
||||||
CFonts.Style = text.Style;
|
|
||||||
return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearScreen()
|
public void ClearScreen()
|
||||||
{
|
{
|
||||||
_G.Clear(_ClearColor);
|
_G.Clear(_ClearColor);
|
||||||
@@ -351,12 +337,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
_G.DrawLine(new Pen(Color.FromArgb(a, r, g, b), w), new Point(x1, y1), new Point(x2, y2));
|
_G.DrawLine(new Pen(Color.FromArgb(a, r, g, b), w), new Point(x1, y1), new Point(x2, y2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw Basic Text
|
|
||||||
public void DrawText(string text, int x, int y, int h, int z = 0)
|
|
||||||
{
|
|
||||||
CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DrawColor(SColorF color, SRectF rect) {}
|
public void DrawColor(SColorF color, SRectF rect) {}
|
||||||
|
|
||||||
public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {}
|
public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {}
|
||||||
@@ -491,7 +471,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
{
|
{
|
||||||
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
if ((texture.Index >= 0) && (_Textures.Count > 0) && (_Bitmaps.Count > texture.Index))
|
||||||
{
|
{
|
||||||
Bitmap coloredBitmap = ColorizeBitmap(_Bitmaps[texture.Index], color);
|
Bitmap coloredBitmap = _ColorizeBitmap(_Bitmaps[texture.Index], color);
|
||||||
_G.DrawImage(coloredBitmap, new RectangleF(rect.X, rect.Y, rect.W, rect.H));
|
_G.DrawImage(coloredBitmap, new RectangleF(rect.X, rect.Y, rect.W, rect.H));
|
||||||
coloredBitmap.Dispose();
|
coloredBitmap.Dispose();
|
||||||
}
|
}
|
||||||
@@ -506,7 +486,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return _Textures.Count;
|
return _Textures.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Bitmap ColorizeBitmap(Bitmap original, SColorF color)
|
private static Bitmap _ColorizeBitmap(Bitmap original, SColorF color)
|
||||||
{
|
{
|
||||||
Bitmap newBitmap = new Bitmap(original.Width, original.Height);
|
Bitmap newBitmap = new Bitmap(original.Width, original.Height);
|
||||||
|
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
return samples / 2;
|
return samples / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private int _CheckColorDepth(int setValue)
|
private int _CheckColorDepth(int setValue)
|
||||||
{
|
{
|
||||||
int result = 16;
|
int result = 16;
|
||||||
@@ -213,6 +214,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
|
|
||||||
return result - 8;
|
return result - 8;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private void _ToggleFullScreen()
|
private void _ToggleFullScreen()
|
||||||
{
|
{
|
||||||
@@ -481,19 +483,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
{
|
{
|
||||||
return _Control.Height;
|
return _Control.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RectangleF GetTextBounds(CText text)
|
|
||||||
{
|
|
||||||
return GetTextBounds(text, text.Height);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RectangleF GetTextBounds(CText text, float height)
|
|
||||||
{
|
|
||||||
CFonts.Height = height;
|
|
||||||
CFonts.SetFont(text.Font);
|
|
||||||
CFonts.Style = text.Style;
|
|
||||||
return new RectangleF(text.X, text.Y, CFonts.GetTextWidth(CLanguage.Translate(text.Text)), CFonts.GetTextHeight(CLanguage.Translate(text.Text)));
|
|
||||||
}
|
|
||||||
#endregion main stuff
|
#endregion main stuff
|
||||||
|
|
||||||
#region Basic Draw Methods
|
#region Basic Draw Methods
|
||||||
@@ -583,12 +572,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
|
|
||||||
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) {}
|
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) {}
|
||||||
|
|
||||||
// Draw Basic Text (must be deleted later)
|
|
||||||
public void DrawText(string text, int x, int y, int h, int z = 0)
|
|
||||||
{
|
|
||||||
CFonts.DrawText(text, h, x, y, z, new SColorF(1, 1, 1, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DrawColor(SColorF color, SRectF rect)
|
public void DrawColor(SColorF color, SRectF rect)
|
||||||
{
|
{
|
||||||
GL.Enable(EnableCap.Blend);
|
GL.Enable(EnableCap.Blend);
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
int GetScreenWidth();
|
int GetScreenWidth();
|
||||||
int GetScreenHeight();
|
int GetScreenHeight();
|
||||||
|
|
||||||
RectangleF GetTextBounds(CText text);
|
|
||||||
RectangleF GetTextBounds(CText text, float height);
|
|
||||||
|
|
||||||
// Basic Draw Methods
|
// Basic Draw Methods
|
||||||
void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2);
|
void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2);
|
||||||
void DrawColor(SColorF color, SRectF rect);
|
void DrawColor(SColorF color, SRectF rect);
|
||||||
@@ -45,9 +42,6 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
void CopyScreen(ref STexture texture);
|
void CopyScreen(ref STexture texture);
|
||||||
void MakeScreenShot();
|
void MakeScreenShot();
|
||||||
|
|
||||||
// Draw Basic Text (must be deleted later)
|
|
||||||
void DrawText(string text, int x, int y, int h, int z = 0);
|
|
||||||
|
|
||||||
STexture AddTexture(string texturePath);
|
STexture AddTexture(string texturePath);
|
||||||
STexture AddTexture(Bitmap bitmap);
|
STexture AddTexture(Bitmap bitmap);
|
||||||
STexture AddTexture(int w, int h, IntPtr data);
|
STexture AddTexture(int w, int h, IntPtr data);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using Vocaluxe.Base.Fonts;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
@@ -212,7 +213,7 @@ namespace Vocaluxe.Screens
|
|||||||
continue;
|
continue;
|
||||||
string newLine = " " + paragraph[e];
|
string newLine = " " + paragraph[e];
|
||||||
CText text = GetNewText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
|
CText text = GetNewText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
|
||||||
if (CDraw.GetTextBounds(text).Width < (CSettings.RenderW - 220))
|
if (CFonts.GetTextBounds(text).Width < (CSettings.RenderW - 220))
|
||||||
{
|
{
|
||||||
line += newLine;
|
line += newLine;
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
CFonts.SetFont("Normal");
|
CFonts.SetFont("Normal");
|
||||||
CFonts.Style = EStyle.Normal;
|
CFonts.Style = EStyle.Normal;
|
||||||
CDraw.DrawText(CSettings.GetFullVersionText(), 10, 680, 40);
|
CFonts.DrawText(CSettings.GetFullVersionText(), 10, 680, 40);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using Vocaluxe.Base.Fonts;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ namespace VocaluxeLib.Menu
|
|||||||
if (n.Type == ENoteType.Freestyle)
|
if (n.Type == ENoteType.Freestyle)
|
||||||
_Text.Style = EStyle.BoldItalic;
|
_Text.Style = EStyle.BoldItalic;
|
||||||
|
|
||||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rect = CBase.Fonts.GetTextBounds(_Text);
|
||||||
_Width += rect.Width;
|
_Width += rect.Width;
|
||||||
_Notes.Add(n);
|
_Notes.Add(n);
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Text.X = x;
|
_Text.X = x;
|
||||||
_Text.Style = EStyle.Bold;
|
_Text.Style = EStyle.Bold;
|
||||||
_Text.Text = note.Text;
|
_Text.Text = note.Text;
|
||||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rect = CBase.Fonts.GetTextBounds(_Text);
|
||||||
|
|
||||||
if (note.Type == ENoteType.Freestyle)
|
if (note.Type == ENoteType.Freestyle)
|
||||||
_Text.Style = EStyle.BoldItalic;
|
_Text.Style = EStyle.BoldItalic;
|
||||||
@@ -326,7 +326,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Text.X = x;
|
_Text.X = x;
|
||||||
_Text.Style = EStyle.Bold;
|
_Text.Style = EStyle.Bold;
|
||||||
_Text.Text = _Notes[note].Text;
|
_Text.Text = _Notes[note].Text;
|
||||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rect = CBase.Fonts.GetTextBounds(_Text);
|
||||||
|
|
||||||
if (_Notes[note].Type == ENoteType.Freestyle)
|
if (_Notes[note].Type == ENoteType.Freestyle)
|
||||||
_Text.Style = EStyle.BoldItalic;
|
_Text.Style = EStyle.BoldItalic;
|
||||||
@@ -374,7 +374,7 @@ namespace VocaluxeLib.Menu
|
|||||||
if (_Notes[zoomNote].Type == ENoteType.Freestyle)
|
if (_Notes[zoomNote].Type == ENoteType.Freestyle)
|
||||||
_Text.Style = EStyle.BoldItalic;
|
_Text.Style = EStyle.BoldItalic;
|
||||||
|
|
||||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rect = CBase.Fonts.GetTextBounds(_Text);
|
||||||
|
|
||||||
float diff = endBeat - _Notes[zoomNote].StartBeat;
|
float diff = endBeat - _Notes[zoomNote].StartBeat;
|
||||||
if (diff <= 0f)
|
if (diff <= 0f)
|
||||||
@@ -392,7 +392,7 @@ namespace VocaluxeLib.Menu
|
|||||||
float tz = _Text.Z;
|
float tz = _Text.Z;
|
||||||
|
|
||||||
_Text.Height += _Text.Height * p * 0.4f;
|
_Text.Height += _Text.Height * p * 0.4f;
|
||||||
RectangleF rectz = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rectz = CBase.Fonts.GetTextBounds(_Text);
|
||||||
_Text.X -= (rectz.Width - rect.Width) / 2f;
|
_Text.X -= (rectz.Width - rect.Width) / 2f;
|
||||||
_Text.Y -= (rectz.Height - rect.Height) / 2f;
|
_Text.Y -= (rectz.Height - rect.Height) / 2f;
|
||||||
_Text.Z -= 0.1f;
|
_Text.Z -= 0.1f;
|
||||||
@@ -415,7 +415,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Text.X = x;
|
_Text.X = x;
|
||||||
_Text.Style = EStyle.Bold;
|
_Text.Style = EStyle.Bold;
|
||||||
_Text.Text = note.Text;
|
_Text.Text = note.Text;
|
||||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rect = CBase.Fonts.GetTextBounds(_Text);
|
||||||
|
|
||||||
if (note.Type == ENoteType.Freestyle)
|
if (note.Type == ENoteType.Freestyle)
|
||||||
_Text.Style = EStyle.BoldItalic;
|
_Text.Style = EStyle.BoldItalic;
|
||||||
@@ -456,7 +456,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Text.X = x;
|
_Text.X = x;
|
||||||
_Text.Style = EStyle.Bold;
|
_Text.Style = EStyle.Bold;
|
||||||
_Text.Text = _Notes[note].Text;
|
_Text.Text = _Notes[note].Text;
|
||||||
RectangleF rect = CBase.Drawing.GetTextBounds(_Text);
|
RectangleF rect = CBase.Fonts.GetTextBounds(_Text);
|
||||||
|
|
||||||
if (_Notes[note].Type == ENoteType.Freestyle)
|
if (_Notes[note].Type == ENoteType.Freestyle)
|
||||||
_Text.Style = EStyle.BoldItalic;
|
_Text.Style = EStyle.BoldItalic;
|
||||||
|
|||||||
@@ -1016,7 +1016,7 @@ namespace VocaluxeLib.Menu
|
|||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case EType.Text:
|
case EType.Text:
|
||||||
RectangleF bounds = CBase.Drawing.GetTextBounds(_Texts[interact.Num]);
|
RectangleF bounds = CBase.Fonts.GetTextBounds(_Texts[interact.Num]);
|
||||||
if (CHelper.IsInBounds(new SRectF(_Texts[interact.Num].X, _Texts[interact.Num].Y, bounds.Width, bounds.Height, _Texts[interact.Num].Z), x, y))
|
if (CHelper.IsInBounds(new SRectF(_Texts[interact.Num].X, _Texts[interact.Num].Y, bounds.Width, bounds.Height, _Texts[interact.Num].Z), x, y))
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -764,7 +764,7 @@ namespace VocaluxeLib.Menu
|
|||||||
alpha = new SColorF(1f, 1f, 1f, 1f);
|
alpha = new SColorF(1f, 1f, 1f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
RectangleF bounds = CBase.Drawing.GetTextBounds(text);
|
RectangleF bounds = CBase.Fonts.GetTextBounds(text);
|
||||||
text.X = (x + dx / 2f + dx * i) + TextRelativeX;
|
text.X = (x + dx / 2f + dx * i) + TextRelativeX;
|
||||||
|
|
||||||
if (!WithTextures)
|
if (!WithTextures)
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public void Draw(float begin, float end)
|
public void Draw(float begin, float end)
|
||||||
{
|
{
|
||||||
RectangleF bounds = CBase.Fonts.GetTextBounds(this, Height);
|
RectangleF bounds = CBase.Fonts.GetTextBounds(this);
|
||||||
|
|
||||||
float x = X;
|
float x = X;
|
||||||
switch (Align)
|
switch (Align)
|
||||||
@@ -597,7 +597,7 @@ namespace VocaluxeLib.Menu
|
|||||||
CBase.Fonts.SetFont(Font);
|
CBase.Fonts.SetFont(Font);
|
||||||
CBase.Fonts.SetStyle(Style);
|
CBase.Fonts.SetStyle(Style);
|
||||||
|
|
||||||
RectangleF bounds = CBase.Fonts.GetTextBounds(this, Height);
|
RectangleF bounds = CBase.Fonts.GetTextBounds(this);
|
||||||
|
|
||||||
if (bounds.Width > Bounds.W && Bounds.W > 0f && bounds.Width > 0f)
|
if (bounds.Width > Bounds.W && Bounds.W > 0f && bounds.Width > 0f)
|
||||||
{
|
{
|
||||||
@@ -691,7 +691,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
float h = Height;
|
float h = Height;
|
||||||
float y = Y;
|
float y = Y;
|
||||||
RectangleF bounds = CBase.Fonts.GetTextBounds(this, Height);
|
RectangleF bounds = CBase.Fonts.GetTextBounds(this);
|
||||||
|
|
||||||
if (bounds.Width > Bounds.W && Bounds.W > 0f && bounds.Width > 0f)
|
if (bounds.Width > Bounds.W && Bounds.W > 0f && bounds.Width > 0f)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -159,8 +159,6 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public interface IDrawing
|
public interface IDrawing
|
||||||
{
|
{
|
||||||
RectangleF GetTextBounds(CText text);
|
|
||||||
|
|
||||||
void DrawTexture(STexture texture, SRectF rect);
|
void DrawTexture(STexture texture, SRectF rect);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color);
|
void DrawTexture(STexture texture, SRectF rect, SColorF color);
|
||||||
void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds);
|
void DrawTexture(STexture texture, SRectF rect, SColorF color, SRectF bounds);
|
||||||
@@ -192,6 +190,7 @@ namespace VocaluxeLib.Menu
|
|||||||
void SetFont(string fontName);
|
void SetFont(string fontName);
|
||||||
void SetStyle(EStyle fontStyle);
|
void SetStyle(EStyle fontStyle);
|
||||||
|
|
||||||
|
RectangleF GetTextBounds(CText text);
|
||||||
RectangleF GetTextBounds(CText text, float textHeight);
|
RectangleF GetTextBounds(CText text, float textHeight);
|
||||||
|
|
||||||
void DrawText(string text, float textHeight, float x, float y, float z, SColorF color);
|
void DrawText(string text, float textHeight, float x, float y, float z, SColorF color);
|
||||||
|
|||||||
Reference in new issue
Block a user