Skip to content

Commit eef1046

Browse files
committed
Text shadows
1 parent d01f19f commit eef1046

File tree

6 files changed

+32
-3
lines changed

6 files changed

+32
-3
lines changed

menu/palette.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var lightWarning = video.Color{R: 1.00, G: 0.92, B: 0.53, A: 1}
3333
var bgColor = white
3434
var cursorBg = cyan
3535
var textColor = black
36+
var textShadowColor = white
3637
var sepColor = lightGrey
3738
var hintTextColor = darkGrey
3839
var hintBgColor = white
@@ -47,6 +48,7 @@ func (m *Menu) UpdatePalette() {
4748
bgColor = darkerGrey
4849
cursorBg = darkBlue
4950
textColor = white
51+
textShadowColor = black
5052
sepColor = darkerGrey
5153
hintTextColor = white
5254
hintBgColor = black

menu/scene.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ func genericRender(list *entry) {
194194
0.5, 0, textColor.Alpha(e.iconAlpha))
195195

196196
if e.labelAlpha > 0 {
197+
menu.Font.SetColor(textShadowColor.Alpha(e.labelAlpha / 2))
198+
menu.Font.Printf(
199+
(670+1)*menu.ratio,
200+
float32(h)*e.yp+fontOffset+1*menu.ratio,
201+
0.5*menu.ratio, e.label)
197202
menu.Font.SetColor(textColor.Alpha(e.labelAlpha))
198203
menu.Font.Printf(
199204
670*menu.ratio,

menu/scene_history.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,13 @@ func (s *sceneHistory) render() {
198198
slOffset = 30 * menu.ratio * e.subLabelAlpha
199199
}
200200

201-
menu.Font.SetColor(textColor.Alpha(e.labelAlpha))
202201
stack := 840 * menu.ratio
202+
menu.Font.SetColor(textShadowColor.Alpha(e.labelAlpha / 2))
203+
menu.Font.Printf(
204+
(840+1)*menu.ratio,
205+
float32(h)*e.yp+fontOffset-slOffset+1*menu.ratio,
206+
0.5*menu.ratio, e.label)
207+
menu.Font.SetColor(textColor.Alpha(e.labelAlpha))
203208
menu.Font.Printf(
204209
840*menu.ratio,
205210
float32(h)*e.yp+fontOffset-slOffset,

menu/scene_playlist.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,18 @@ func (s *scenePlaylist) render() {
236236
e.scale, 0, white.Alpha(e.iconAlpha))
237237
}
238238

239-
menu.Font.SetColor(textColor.Alpha(e.labelAlpha))
240239
stack := 840 * menu.ratio
240+
menu.Font.SetColor(textShadowColor.Alpha(e.labelAlpha / 2))
241+
menu.Font.Printf(
242+
(840+1)*menu.ratio,
243+
float32(h)*e.yp+fontOffset+1*menu.ratio,
244+
0.5*menu.ratio, e.label)
245+
menu.Font.SetColor(textColor.Alpha(e.labelAlpha))
241246
menu.Font.Printf(
242247
840*menu.ratio,
243248
float32(h)*e.yp+fontOffset,
244249
0.5*menu.ratio, e.label)
250+
245251
stack += float32(int(menu.Font.Width(0.5*menu.ratio, e.label)))
246252
stack += 10
247253

menu/scene_savestates.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ func (s *sceneSavestates) render() {
153153
e.scale, 0, textColor.Alpha(e.iconAlpha))
154154
}
155155

156+
menu.Font.SetColor(textShadowColor.Alpha(e.labelAlpha / 2))
157+
menu.Font.Printf(
158+
(840+1)*menu.ratio,
159+
float32(h)*e.yp+fontOffset+1*menu.ratio,
160+
0.5*menu.ratio, e.label)
161+
156162
menu.Font.SetColor(textColor.Alpha(e.labelAlpha))
157163
menu.Font.Printf(
158164
840*menu.ratio,

menu/scene_tabs.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,15 @@ func (tabs sceneTabs) render() {
295295
stackWidth += e.width*menu.ratio + e.margin*menu.ratio
296296

297297
if e.labelAlpha > 0 {
298-
menu.Font.SetColor(c.Alpha(e.labelAlpha))
299298
lw := menu.Font.Width(0.5*menu.ratio, e.label)
299+
menu.Font.SetColor(textShadowColor.Alpha(e.labelAlpha / 2))
300+
menu.Font.Printf(x-lw/2+1*menu.ratio, float32(int(float32(h)/2+(250+1)*menu.ratio)), 0.5*menu.ratio, e.label)
301+
menu.Font.SetColor(c.Alpha(e.labelAlpha))
300302
menu.Font.Printf(x-lw/2, float32(int(float32(h)/2+250*menu.ratio)), 0.5*menu.ratio, e.label)
301303
lw = menu.Font.Width(0.4*menu.ratio, e.subLabel)
304+
menu.Font.SetColor(textShadowColor.Alpha(e.labelAlpha / 2))
305+
menu.Font.Printf(x-lw/2+1*menu.ratio, float32(int(float32(h)/2+(330+1)*menu.ratio)), 0.4*menu.ratio, e.subLabel)
306+
menu.Font.SetColor(c.Alpha(e.labelAlpha))
302307
menu.Font.Printf(x-lw/2, float32(int(float32(h)/2+330*menu.ratio)), 0.4*menu.ratio, e.subLabel)
303308
}
304309

0 commit comments

Comments
 (0)