Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
doyousketch2 edited this page Sep 13, 2019 · 5 revisions

Valuator (abstract):

Corresponds to: Fl_Valuator


Functions

  • obj:bounds( int min, int max )
  • obj:clamp( int val ) ==> int newVal

    clamps value to range

  • obj:format() ==> str val

    if step value zero then %g format
    else %.*f format w/ digits for step value

  • obj:increment( int value, int n ) ==> int newVal

    adds (n times step) to value
    if step 0, use (max - min) / 100

  • obj:range( int min, int max )

    clamping is done after rounding to step value

  • obj:round( int val ) ==> int newVal

    Round to nearest step increment
    Does nothing if step is zero


Properties

  • obj.step ==> int val get

    obj.step = int val set

  • obj.value ==> int val get

    obj.value ==> int val set

  • obj.maximum ==> int max get

    obj.maximum = int max set

  • obj.minimum ==> int min get

    obj.minimum = int min set

  • obj.precision = int digits set

    Sets step to 1.0 / 10 digits

Clone this wiki locally
Morty Proxy This is a proxified and sanitized view of the page, visit original site.