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§
Structs§
Enums§
Traits§
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
tox2, y2
with a stroke width ofwidth
. - draw_
rect - Draws a
width
byheight
rect atx, 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 givencolor
and fill, or winding,rule
. - fill_
rect - Draws a filled
width
byheight
rect atx, y
. - fill_
triangle - Draws a filled triangle with points at
x1, y1
,x2, y2
, andx3, 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.