width

Returns the width of the display in pixels. Since the display is addressed from zero, the maximum displayable pixel number is one less than the width.

If an optional sprite or image argument is given, returns the width of the sprite or image.

Usage

    MAX_X = width() - 1;
    image_width = width(image);
    sprite_width = width(sprite);