# NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

# tx.nudge()

## Syntax

    nudge(x=0.0, y=0.0, baseline=True, growth=1.0, invert=False)

## Description

Sets a horizontal and vertical nudge factor. Nudge is an incrementor for the spacing() command, meaning that when you nudge a paragraph() from the left, letterspacing will increase at the right of the paragraph. The harder you nudge, the more it increases: double the defined letterspacing at the right edge for a horizontal nudge of 1.0 (100%).

With "from the left" we actually mean that the center of gravity, defined with the center() command is somewhere to the left of the paragraph.

The baseline argument specifies whether or not to ignore a straight baseline. When set to false and nudging text vertically, lines of text will seem to fall (or rise) the further they are from the center of gravity.

The growth argument specifies the nudge increment factor, as characters move farther away from the centre. Normal increase is 1.0, double is 2.0, and so on.

## Example

    font("Dolly-Bold", 11)
    import tx
    string = "A very normal looking paragraph... on the surface..."
    tx.center(0.0, -3.0)
    tx.spacing(0.0, 0.1)
    tx.nudge(0.0, 0.2, growth=3.0, baseline=False)
    tx.paragraph(string, 10, 20, 80)