HUD text (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | alignment_ | = | ALIGN_LEFT_BOTTOM |
the point of the text at |
|
| real(kind=wp), | private | :: | color_(4) | = | [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp] |
[r, g, b, a] (0 to 1) |
|
| character(len=:), | private, | allocatable | :: | font_ |
font file (unallocated: the default font) |
||
| real(kind=wp), | private | :: | position_(2) | = | [0.01_wp, 0.01_wp] |
[x, y] (0 to 1 across the window, y up) |
|
| integer, | private | :: | revision_ | = | 0 |
incremented by each change |
|
| logical, | private | :: | shown | = | .true. |
false while hidden |
|
| real(kind=wp), | private | :: | size_ | = | 20.0_wp |
character height (window units) |
|
| character(len=:), | private, | allocatable | :: | text_ |
the text |
The HUDText constructor: HUDText(...) makes one (see new_hud_text for its
arguments).
HUD text text, optionally at position ([x, y], 0 to 1; default near
the bottom left), with alignment (default ALIGN_LEFT_BOTTOM), size
(window units; default 20), color ([r, g, b] or [r, g, b, a]; default
white) and font (default: the default font).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
the text |
||
| real(kind=wp), | intent(in), | optional | :: | position(2) |
[x, y] (0 to 1 across the window, y up) |
|
| integer, | intent(in), | optional | :: | alignment |
an ALIGN_* constant |
|
| real(kind=wp), | intent(in), | optional | :: | size |
character height (window units) |
|
| real(kind=wp), | intent(in), | optional | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
|
| character(len=*), | intent(in), | optional | :: | font |
font file |
Set which point of the text is at its position.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(HUDText), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | alignment |
an ALIGN_* constant |
Set where the text is.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(HUDText), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | position(2) |
[x, y] (0 to 1 across the window, y up) |
type, public :: HUDText private character(len=:), allocatable :: text_ !! the text real(wp) :: position_(2) = [0.01_wp, 0.01_wp] !! [x, y] (0 to 1 across the window, y up) integer :: alignment_ = ALIGN_LEFT_BOTTOM !! the point of the text at `position_` (ALIGN_*) real(wp) :: size_ = 20.0_wp !! character height (window units) real(wp) :: color_(4) = [1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp] !! [r, g, b, a] (0 to 1) character(len=:), allocatable :: font_ !! font file (unallocated: the default font) logical :: shown = .true. !! false while hidden integer :: revision_ = 0 !! incremented by each change contains procedure :: set_text, text procedure :: set_position, position procedure :: set_alignment, alignment procedure :: set_size, size procedure :: set_color, color procedure :: set_font, font procedure :: show, is_shown procedure :: revision end type HUDText