mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 11:28:16 +00:00

[ci skip] Not necessary since the "tiny" resolution was removed a long time ago, and the parameters would implicitly convert to 0 engine-side.
99 lines
2.0 KiB
INI
99 lines
2.0 KiB
INI
#textdomain wesnoth-lib
|
|
###
|
|
### Definition of the title label for the story viewer.
|
|
###
|
|
|
|
# We can't get the exact size of the text outside a [text] element, so estimate it instead.
|
|
# Using an average character width of 12 seems to give good results.
|
|
# Then we centre the text in the estimated width rather than in the entire width.
|
|
|
|
#define _GUI_ESTIMATE_TEXT_WIDTH
|
|
(length(text) * 12)#enddef
|
|
|
|
#define _GUI_CENTER_STORY_TEXT
|
|
(10 + max((box_width - text_width) / 2, 0)
|
|
where box_width = {_GUI_ESTIMATE_TEXT_WIDTH})#enddef
|
|
|
|
#define _GUI_BACKGROUND
|
|
[round_rectangle]
|
|
x = 10
|
|
y = 10
|
|
w = "{_GUI_ESTIMATE_TEXT_WIDTH}"
|
|
h = "(height - 20)"
|
|
corner_radius = 5
|
|
fill_color = "0, 0, 0, 96"
|
|
[/round_rectangle]
|
|
[round_rectangle]
|
|
x = 13
|
|
y = 13
|
|
w = "(text_width - 6 where text_width = {_GUI_ESTIMATE_TEXT_WIDTH})"
|
|
h = "(height - 26)"
|
|
corner_radius = 5
|
|
fill_color = "0, 0, 0, 96"
|
|
[/round_rectangle]
|
|
#enddef
|
|
|
|
#define _GUI_TEXT MODE
|
|
[text]
|
|
#x = "{_GUI_CENTER_STORY_TEXT}"
|
|
x = 20
|
|
#y = {GUI__TEXT_VERTICALLY_CENTRED}
|
|
y = 20
|
|
w = "(width)"
|
|
h = "(text_height)"
|
|
maximum_width = "(width)"
|
|
font_size = {GUI_FONT_SIZE_LARGE}
|
|
color = {GUI__FONT_COLOR_{MODE}__DEFAULT}
|
|
text = "(text)"
|
|
text_markup = "(text_markup)"
|
|
text_alignment = "(text_alignment)"
|
|
text_link_aware = "(text_link_aware)"
|
|
text_link_color = "(text_link_color)"
|
|
[/text]
|
|
#enddef
|
|
|
|
[label_definition]
|
|
id = "story_screen_title"
|
|
description = "Large label with translucent background for story screen"
|
|
|
|
[resolution]
|
|
min_width = 0
|
|
min_height = 0
|
|
|
|
default_width = 0
|
|
default_height = 100
|
|
|
|
max_width = 0
|
|
max_height = 0
|
|
|
|
text_font_size = {GUI_FONT_SIZE_LARGE}
|
|
|
|
link_aware = false
|
|
|
|
[state_enabled]
|
|
|
|
[draw]
|
|
#{_GUI_BACKGROUND}
|
|
{_GUI_TEXT ENABLED}
|
|
[/draw]
|
|
|
|
[/state_enabled]
|
|
|
|
[state_disabled]
|
|
|
|
[draw]
|
|
#{_GUI_BACKGROUND}
|
|
{_GUI_TEXT DISABLED}
|
|
[/draw]
|
|
|
|
[/state_disabled]
|
|
|
|
[/resolution]
|
|
|
|
[/label_definition]
|
|
|
|
#undef _GUI_ESTIMATE_TEXT_WIDTH
|
|
#undef _GUI_CENTER_STORY_TEXT
|
|
#undef _GUI_BACKGROUND
|
|
#undef _GUI_TEXT
|