glgui valuelabel - part-cw/lambdanative GitHub Wiki
(glgui-valuelabel g x y img fnt color . bgcolor)
glgui-valuelabel creates value indicator composed of a right aligned number and a left aligned label, e.g. for units.
Parameter | Description |
---|---|
g | Graphical User Interface (GUI) for this widget |
x | Lower left corner along the x-axis in pixels |
y | Lower left corner along the y-axis in pixels |
img | The image or pixmap texture for the unit label |
fnt | The font for the number string |
color | Color for the value and unit label |
bgcolor | Optional: Background color for the value |
Example
Example 1: Display a HR value (of 80) in green. label_hr is a texture created with the "cmss.ttf 16 "HR//bpm" label_hr" entry in the applications STRINGS file, while num_40.fnt is made with the "cmss.ttf 40 num" line in the applications FONTS file.
(set! hr_value (glgui-valuelabel gui (- (glgui-width-get) 50) (- (glgui-height-get) 70)
label_hr.img num_40.fnt Green))
(let ((hr-val 80))
(glgui-widget-set! gui hr_value 'label (if hr-val (number->string (fix hr-val)) ""))
)