Crate playdate_graphics

Source
Expand description

Playdate graphics API

Re-exports§

pub extern crate color;
pub use bitmap::debug_bitmap;
pub use bitmap::display_buffer_bitmap;
pub use bitmap::copy_frame_buffer_bitmap;
pub use bitmap::set_stencil;
pub use bitmap::set_stencil_tiled;
pub use bitmap::set_draw_mode;
pub use bitmap::push_context;
pub use bitmap::pop_context;

Modules§

api
Global Playdate graphics API.
bitmap
error
text
Playdate text API
video
Playdate video API

Structs§

Graphics

Enums§

BitmapDrawMode
BitmapFlip
LineCapStyle

Traits§

BitmapDrawModeExt
BitmapFlipExt
LineCapStyleExt

Functions§

clear
Clears the entire display, filling it with color.
clear_clip_rect
Clears the current clip rect.
clear_raw
Clears the entire display, filling it with color.
display
Manually flushes the current frame buffer out to the display. This function is automatically called after each pass through the run loop, so there shouldn’t be any need to call it yourself.
draw_ellipse
Draw an ellipse stroked inside the rect.
draw_line
Draws a line from x1, y1 to x2, y2 with a stroke width of width.
draw_rect
Draws a width by height rect at x, y.
fill_ellipse
Fills an ellipse inside the rectangle x, y, width, height.
fill_polygon
Fills the polygon with vertices at the given coordinates (an array of 2 * num_points ints containing alternating x and y values) using the given color and fill, or winding, rule.
fill_rect
Draws a filled width by height rect at x, y.
fill_triangle
Draws a filled triangle with points at x1, y1, x2, y2, and x3, y3.
get_display_frame
Returns the raw bits in the display buffer, the last completed frame.
get_frame
Returns the current display frame buffer. Rows are 32-bit aligned, so the row stride is 52 bytes, with the extra 2 bytes per row ignored. Bytes are MSB-ordered; i.e., the pixel in column 0 is the 0x80 bit of the first byte of the row.
mark_updated_rows
After updating pixels in the buffer returned by get_frame, you must tell the graphics system which rows were updated.
set_background_color
Sets the background color shown when the display is offset or for clearing dirty areas in the sprite system.
set_clip_rect
Sets the current clip rect, using world coordinates that is, the given rectangle will be translated by the current drawing offset.
set_draw_offset
Offsets the origin point for all drawing calls to x, y (can be negative).
set_line_cap_style
Sets the end cap style used in the line drawing functions.
set_screen_clip_rect
Sets the current clip rect in screen coordinates.