src/main/java/com/tajnyprojekt/tpanimation/TpAnimatedVariable.java
private void updateFieldValue() {
        try {
            if (isField) {
                if (isInt()) {
                    field.setInt(parent, PApplet.round(val));
                } else if (isFloat()) {
                    field.setFloat(parent, val);
                } else if (isDouble()) {
                    field.setDouble(parent, val);
                }
            }
            else {
                if (isIntArray()) {
                    ((int[]) array)[index] = PApplet.round(val);
                } else if (isFloatArray()) {
                    ((float[]) array)[index] = val;
                } else if (isDoubleArray()) {
                    ((double[]) array)[index] = val;
                }
            }
        }
        catch (Exception e) {
            TpAnimation.log("An error occured during updating variable's value.", true);
            e.printStackTrace();
        }
    }
/**
     * Updates the sketch's field value
     */
Updates the sketch's field value
Updates the sketch ' s field value
private void updateFieldValue() {
        try {
            if (isField) {
                if (isInt()) {
                    field.setInt(parent, PApplet.round(val));
                } else if (isFloat()) {
                    field.setFloat(parent, val);
                } else if (isDouble()) {
                    field.setDouble(parent, val);
                }
            }
            else {
                if (isIntArray()) {
                    ((int[]) array)[index] = PApplet.round(val);
                } else if (isFloatArray()) {
                    ((float[]) array)[index] = val;
                } else if (isDoubleArray()) {
                    ((double[]) array)[index] = val;
                }
            }
        }
        catch (Exception e) {
            TpAnimation.log("An error occured during updating variable's value.", true);
            e.printStackTrace();
        }
    }
private void updateFieldValue ( ) { try { if ( isField ) { if ( isInt ( ) ) { field . setInt ( parent , PApplet . round ( val ) ) ; } else if ( isFloat ( ) ) { field . setFloat ( parent , val ) ; } else if ( isDouble ( ) ) { field . setDouble ( parent , val ) ; } } else { if ( isIntArray ( ) ) { ( ( int [ ] ) array ) [ index ] = PApplet . round ( val ) ; } else if ( isFloatArray ( ) ) { ( ( float [ ] ) array ) [ index ] = val ; } else if ( isDoubleArray ( ) ) { ( ( double [ ] ) array ) [ index ] = val ; } } } catch ( Exception e ) { TpAnimation . log ( "An error occured during updating variable's value." , true ) ; e . printStackTrace ( ) ; } }
Updates the sketch's field value
Updates the sketch ' s field value