aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-01 20:50:41 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-01 20:50:41 +0000
commitc179ce1e13ecb0528a3a948b4ff75f6a5c4509d8 (patch)
treef0c671fb53dbc9a08448f3b314746accc7ef4949 /src/base
parentc2642efc13ede8debbf6993e8edc588a1ebbf984 (diff)
downloadusdx-c179ce1e13ecb0528a3a948b4ff75f6a5c4509d8.tar.gz
usdx-c179ce1e13ecb0528a3a948b4ff75f6a5c4509d8.tar.xz
usdx-c179ce1e13ecb0528a3a948b4ff75f6a5c4509d8.zip
add SetOutlineColor in TextGL.pas
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3155 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r--src/base/TextGL.pas8
-rw-r--r--src/base/ULyrics.pas30
2 files changed, 37 insertions, 1 deletions
diff --git a/src/base/TextGL.pas b/src/base/TextGL.pas
index 7da1d558..eb61c15e 100644
--- a/src/base/TextGL.pas
+++ b/src/base/TextGL.pas
@@ -73,6 +73,7 @@ procedure SetFontSize(Size: real);
procedure SetFontStyle(Style: integer); // sets active font style (normal, bold, etc)
procedure SetFontItalic(Enable: boolean); // sets italic type letter (works for all fonts)
procedure SetFontReflection(Enable:boolean;Spacing: real); // enables/disables text reflection
+procedure SetOutlineColor(R, G, B, A: GLFloat); // set outline color
implementation
@@ -242,6 +243,7 @@ begin
SetFontZ(0);
SetFontItalic(False);
SetFontReflection(False, 0);
+ SetOutlineColor(0,0,0,1);
end;
procedure SetFontPos(X, Y: real);
@@ -282,4 +284,10 @@ begin
Fonts[ActFont].Font.ReflectionSpacing := Spacing - Fonts[ActFont].Font.Descender;
end;
+procedure SetOutlineColor(R, G, B, A: GLFloat);
+begin
+ if (ActFont > 1) then
+ TFTScalableOutlineFont(Fonts[ActFont].Font).SetOutlineColor(R, G, B, A);
+end;
+
end.
diff --git a/src/base/ULyrics.pas b/src/base/ULyrics.pas
index 3f62db9c..4b2bc4ae 100644
--- a/src/base/ULyrics.pas
+++ b/src/base/ULyrics.pas
@@ -516,7 +516,11 @@ var
WordY: real; // word y-position
LyricsEffect: TLyricsEffect;
Alpha: real; // alphalevel to fade out at end
- ClipPlaneEq: array[0..3] of GLdouble; // clipping plane for slide effect
+ ClipPlaneEq: array[0..3] of GLdouble; // clipping plane for slide effect
+
+ OutlineColor_act: TRGB; // outline color actual line
+ OutlineColor_dis: TRGB; // outline color next line
+ OutlineColor_en: TRGB; // outline color sing line
{// duet mode
IconSize: real; // size of player icons
IconAlpha: real; // alpha level of player icons
@@ -592,6 +596,9 @@ begin
Alpha := 0;
end;
+ // outline color
+ SetOutlineColor(OutlineColor_act.R, OutlineColor_act.G, OutlineColor_act.B, Alpha);
+
// draw sentence before current word
if (LyricsEffect in [lfxSimple, lfxBall, lfxShift]) then
// only highlight current word and not that ones before in this line
@@ -604,10 +611,17 @@ begin
glColorRGB(LineColor_en, Alpha);
if (NextWord <> nil) then
begin
+
+ // outline color
+ SetOutlineColor(OutlineColor_en.R, OutlineColor_en.G, OutlineColor_en.B, Alpha);
+
DrawLyricsWords(Line, LyricX + NextWord.X, LyricY,
Line.CurWord+1, High(Line.Words));
end;
+ // outline color
+ SetOutlineColor(OutlineColor_act.R, OutlineColor_act.G, OutlineColor_act.B, Alpha);
+
// draw current word
if (LyricsEffect in [lfxSimple, lfxBall, lfxShift]) then
begin
@@ -680,12 +694,26 @@ begin
// enable the upper, disable the lower line
if (Line = UpperLine) then
+ begin
+ // outline color
+ SetOutlineColor(OutlineColor_en.R, OutlineColor_en.G, OutlineColor_en.B, Alpha);
+
glColorRGB(LineColor_en)
+ end
else
+ begin
+ // outline color
+ SetOutlineColor(OutlineColor_dis.R, OutlineColor_dis.G, OutlineColor_dis.B, Alpha);
+
glColorRGB(LineColor_dis);
+ end;
DrawLyricsWords(Line, LyricX, LyricY, 0, High(Line.Words));
end;
+
+ // reset
+ SetOutlineColor(0,0,0,1);
+
end;
{**