Skip to content

Latest commit

 

History

History
247 lines (166 loc) · 7.66 KB

txt.md

File metadata and controls

247 lines (166 loc) · 7.66 KB

_txt.affordance {

}

_txt.label {

  • ...

}

_txt.enc.number {

}

_txt.enc.control {

}

_txt.enc.option {

}

_txt.enc.list {

}

_txt.key.number {

}

_txt.key.option {

}

_txt.key.list {

}

_txt.key.trigger {

}

_txt.key.momentary {

}

_txt.key.toggle {

}

affordances

affordance

a base affordance type for the _txt group - all other affordances in the group inherit from this type and share the display properties. the user may extend this type in order to define a custom affordance with text output.

label(type)

an output only text type, value is displayed and may be a string, a table of strings, or a table of tables of strings. useful for evaluating the various display properties. each string provided will be it's own "text block" with positioning and sizing set based on a combination of multiple proeries in the parent affordance (think "norns css").

number

an integer or fractional number. label defaults to k.

control

like the paramset "control" type, a number with musicaly convenient properties. a controlspec is used internally, which may be provided at init time rather than properties. label defaults to k.

option

like the paramset "option" type, a list of strings or numbers to be iterated through. the value property stored is the index of the active option (the value at this index is returned as the third argument to action). all options are displayed, with the index value set to the selected property. useful in conjunction with the scroll_window and scroll_focus properties.

list

like option, but may display a list of other affordance types in the _txt group, enabling only the object at the selected index. think "params menu" but nest_y.

trigger

an affordance that blinks for blinktime seconds and runs action on keypress. selected is set to the high indicies of value. label is the displayed text, which defaults to k.

momentary

a "held" button where value goes high where a key is depressed, low where a key is released. selected is set to the high indicies of value. label is the displayed text, which defaults to k.

toggle

a button where value toggles between high and low on a keypress. if lvl has a table length greater than two, a toggle button will cycle forward through those brightness values. selected is set to the high indicies of value. label is the displayed text, which defaults to k.

properties

font_face

a number indicating the font face.

font_size

a number indicating the font size.

x

the x component of the text position. this may be:

  • a single number, to specify where a text group starts from on this axis (alignment)
  • a table with two values, to specify where a text group begins and ends on this axis (justified)
  • a table of tables, to specify exact boundaries for each string in the text group on this axis (manual placement)

y

the y component of the text position. this may be:

  • a single number, to specify where a text group starts from on this axis (alignment)
  • a table with two values, to specify where a text group begins and ends on this axis (justified)
  • a table of tables, to specify exact boundaries for each string in the text group on this axis (manual placement)

label

a label to be displayed for input types. defaults to k. set label = false to remove the label.

formatter

a function that takes text as an argument & returns transformed text.

step

displayed number values are rounded down to this division (default is 0.01)

lvl

bightness level of the text to display.

border

brightness level of the text box border. 0 for no border.

fill

brightness level of the text box fill. 0 for no fill.

size

a specifies a static width and height for the text box. a table of two sets width & height independently. the flag 'auto' spefifies that an axis should be sized automatically.

padding

the padding space between text and box edges for an auto-sized box.

margin

the space between multiple text boxes.

flow

specifies the axis over which a text group will flow. either 'x' or 'y'.

align

sets position alignment for a text group axis when x and/or y is a single number. may take the form:

  • 'left', 'center' or 'right'
  • { ['left' / 'center' / 'right'] , ['top' / 'bottom' / 'center'] }

line_wrap

specifies a single line of a text group to wrap to the next line after this number of strings has been placed on the line.

selected

specifies an index or a table of indicies to be "selected" within a text group. for the properties lvl, border, fill, font_face, font_size, a table of two values my be provided, the first of which correlates to an unselected item, the second for a selected. this is mostly set by objects internally, see types.

scroll_window

when selection is used, specifies a number of text items to scroll through. useful for option or list affordances with many items.

scroll_focus

specifies a boundary within the window the selection will move across before scrolling. either a single index or a table of min/max boundaries.