g4p_controls

Class GSlider2D

    • Constructor Detail

      • GSlider2D

        public GSlider2D(processing.core.PApplet theApplet,
                 float p0,
                 float p1,
                 float p2,
                 float p3)
        Create a 2D slider inside the specified rectangle.
        Parameters:
        theApplet -
        p0 -
        p1 -
        p2 -
        p3 -
    • Method Detail

      • setEasing

        public void setEasing(float easeBy)
        Set the amount of easing to be used when a value is changing. The default value is 1 (no easing) values > 1 will cause the value to rush from its starting value and decelerate towards its final values. In other words it smoothes the movement of the slider thumb or knob rotation.
        Parameters:
        easeBy - the easing to set
      • setXlimits

        public void setXlimits(int start,
                      int end)
        X (horz) limits Sets the range of values to be returned. This method will assume that you want to set the valueType to INTEGER
        Parameters:
        start - the start value of the range
        end - the end value of the range
      • setLimitsX

        public void setLimitsX(int initValue,
                      int start,
                      int end)
        X (horz) limits Sets the initial value and the range of values to be returned. This method will assume that you want to set the valueType to INTEGER.
        Parameters:
        initValue - the initial value
        start - the start value of the range
        end - the end value of the range
      • setLimitsX

        public void setLimitsX(float start,
                      float end)
        X (horz) limits Sets the range of values to be returned. This method will assume that you want to set the valueType to DECIMAL
        Parameters:
        start -
        end -
      • setLimitsX

        public void setLimitsX(float initValue,
                      float start,
                      float end)
        X (horz) limits Sets the initial value and the range of values to be returned. This method will assume that you want to set the valueType to DECIMAL.
        Parameters:
        initValue - the initial value
        start - the start value of the range
        end - the end value of the range
      • setLimitsY

        public void setLimitsY(int start,
                      int end)
        Y (vert) limits Sets the range of values to be returned. This method will assume that you want to set the valueType to INTEGER
        Parameters:
        start - the start value of the range
        end - the end value of the range
      • setLimitsY

        public void setLimitsY(int initValue,
                      int start,
                      int end)
        Y (vert) limits Sets the initial value and the range of values to be returned. This method will assume that you want to set the valueType to INTEGER.
        Parameters:
        initValue - the initial value
        start - the start value of the range
        end - the end value of the range
      • setLimitsY

        public void setLimitsY(float start,
                      float end)
        Y (vert) limits Sets the range of values to be returned. This method will assume that you want to set the valueType to DECIMAL
        Parameters:
        start -
        end -
      • setLimitsY

        public void setLimitsY(float initValue,
                      float start,
                      float end)
        Y (vert) limits Sets the initial value and the range of values to be returned. This method will assume that you want to set the valueType to DECIMAL.
        Parameters:
        initValue - the initial value
        start - the start value of the range
        end - the end value of the range
      • setValueX

        public void setValueX(float v)
        Set the X (horz) value for the slider.
        The value supplied will be constrained to the current limits.
        Parameters:
        v - the new value
      • setValueY

        public void setValueY(float v)
        Set the Y (vert) value for the slider.
        The value supplied will be constrained to the current limits.
        Parameters:
        v - the new value
      • setValueXY

        public void setValueXY(float vx,
                      float vy)
        Set both the XY values for the slider.
        The values supplied will be constrained to the appropriate current limits.
        Parameters:
        vx - the new X (horz) value
        vy - the new Y (vert) value
      • getValueXF

        public float getValueXF()
        Get the current X value as a float
      • getValueXI

        public int getValueXI()
        Get the current X value as an integer.
        DECIMAL and EXPONENT value types will be rounded to the nearest integer.
      • getValueXS

        public java.lang.String getValueXS()
        Get the current X value as a string taking into account the number format.
      • getValueYF

        public float getValueYF()
        Get the current Y value as a float
      • getValueYI

        public int getValueYI()
        Get the current Y value as an integer.
        DECIMAL and EXPONENT value types will be rounded to the nearest integer.
      • getValueYS

        public java.lang.String getValueYS()
        Get the current Y value as a string taking into account the number format.
      • setPrecision

        public void setPrecision(int nd)
        For DECIMAL values this sets the number of decimal places to be displayed.
        Parameters:
        nd - must be >= 1 otherwise will use 1
      • setNumberFormat

        public void setNumberFormat(int numberFormat,
                           int precision)
        Set the numberFormat and precision in one go.
        Valid number formats are INTEGER, DECIMAL, EXPONENT
        Precision must be >= 1 and is ignored for INTEGER.
        Parameters:
        numberFormat - G4P.INTEGER, G4P.DECIMAL orG4P. EXPONENT
        precision - must be >= 1
      • setNumberFormat

        public void setNumberFormat(int numberFormat)
        Set the numberFormat and precision in one go.
        Valid number formats are INTEGER, DECIMAL, EXPONENT
        Precision must be >= 1 and is ignored for INTEGER.
        Parameters:
        numberFormat - G4P.INTEGER, G4P.DECIMAL or G4P.EXPONENT

Processing library G4P by Peter Lager. (c) 2017