A label node: text at position in color rgba, in font font_name
('' for the default), aligned by alignment (an ALIGN_* constant of
vkf_frames). size > 0: size window units tall; size < 0: -size
scene units tall, but at most max_size window units on screen. Null if
the font is missing.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
the label's text |
||
| real(kind=wp), | intent(in) | :: | position(3) |
(the coordinates of the node it is put under) |
||
| real(kind=wp), | intent(in) | :: | rgba(4) |
color [r, g, b, a] (0 to 1) |
||
| real(kind=wp), | intent(in) | :: | size |
|
||
| real(kind=wp), | intent(in) | :: | max_size |
for size < 0: the largest height on screen (window units) |
||
| integer, | intent(in) | :: | alignment |
an ALIGN_* constant of vkf_frames |
||
| character(len=*), | intent(in) | :: | font_name |
font file ('' for the default) |
function label_create(text, position, rgba, size, max_size, alignment, font_name) result(node) character(len=*), intent(in) :: text !! the label's text real(wp), intent(in) :: position(3) !! (the coordinates of the node it is put under) real(wp), intent(in) :: rgba(4) !! color [r, g, b, a] (0 to 1) real(wp), intent(in) :: size !! > 0: height in window units; < 0: -height in scene units real(wp), intent(in) :: max_size !! for size < 0: the largest height on screen (window units) integer, intent(in) :: alignment !! an ALIGN_* constant of vkf_frames character(len=*), intent(in) :: font_name !! font file ('' for the default) type(c_ptr) :: node type(c_ptr) :: font integer :: h, v node = c_null_ptr font = get_font(font_name) if (.not. c_associated(font)) return call vsg_alignment(alignment, h, v) node = vkf_label_create(font, text, len(text, kind=c_int), real(rgba, c_float), real(position, c_double), & real(size, c_float), real(max_size, c_float), int(h, c_int), int(v, c_int)) end function label_create