Module ggez::graphics [] [src]

The graphics module performs the actual drawing of images, text, and other objects with the Drawable trait. It also handles basic loading of images and text.

This module also manages graphics state, coordinate systems, etc. The default coordinate system has the origin in the upper-left corner of the screen.

Structs

GraphicsContext

A structure that contains graphics state. For instance, background and foreground colors.

Image

In-memory image data available to be drawn on the screen.

Point

Immutable point type, consisting of x and y.

Rect

A rectangle.

Text

Drawable text created from a Font.

Enums

BlendMode
Color
DrawMode

Specifies whether a shape should be drawn filled or as an outline.

Font

A font that defines the shape of characters drawn on the screen. Can be created from a .ttf file or from an image (bitmap fonts).

Traits

Drawable

All types that can be drawn on the screen implement the Drawable trait.

Functions

clear

Clear the screen to the background color.

draw

Draws the given Drawable object to the screen.

draw_ex

Draws the given Drawable object to the screen, applying a rotation and mirroring if desired.

line

Draws a line. Currently lines are 1 pixel wide and generally ugly.

lines

Draws a series of connected lines.

point

Draws a 1-pixel point.

points

Draws a set of points.

present

Tells the graphics system to actually put everything on the screen. Call this at the end of your GameState's draw() method.

print

Not implemented

printf

Not implemented

rectangle

Draws a rectangle.

rectangles

Draws many rectangles. Not part of the LOVE API but no reason not to include it.

set_background_color

Sets the background color. Default: blue.

set_color

Sets the foreground color, which will be used for drawing rectangles, lines, etc. Default: white.