Struct flo_canvas::CanvasGraphicsContext [−][src]
pub struct CanvasGraphicsContext<'a> { /* fields omitted */ }Expand description
Graphics context for a Canvas
Trait Implementations
Suspends rendering to the display until the next ‘ShowFrame’ Read more
Displays any requested queued after ‘StartFrame’
Resets the frame count back to 0 (for when regenerating the state of a canvas)
Move to a new point in the current path (paths should always begin with a move instruction, and moves can define subpaths)
Adds a bezier curve to the current path
Closes the current path (adds a line to the last move point)
Sets the line width for the next stroke() operation
Sets the line width for the next stroke() operation in device pixels
Sets the line join style for the next stroke() operation
Sets the style of the start and end cap of the next line drawn by the stroke() operation
Sets the winding rule used to determine if an internal subpath should be filled or empty
Starts defining a new dash pattern
Adds a dash of the specified length to the dash pattern (alternating between drawing and gap lengths)
Sets the offset for where the dash pattern starts at the next stroke
Sets the colour of the next fill() operation
Sets the texture to use for the next fill() operation
Sets the gradient to use for the next fill() operation
Applies a transformation to the fill texture or gradient
Sets the colour to use for the next stroke() operation
Sets the blend mode of the next fill or stroke operation
Reset the canvas transformation to the identity transformation (so that the y axis goes from -1 to 1)
Sets a transformation such that: (0,0) is the center point of the canvas (0,height/2) is the top of the canvas Pixels are square Read more
Moves a particular region to the center of the canvas (coordinates are minx, miny, maxx, maxy)
Multiply a 2D transform by the current transformation
Releases the memory allocated by the last store() operation
Stores the current state of the canvas (line width, fill colour, etc)
Clears the canvas entirely to a background colour, and removes any stored resources (layers, sprites, fonts, textures)
Selects a particular layer for drawing Layer 0 is selected initially. Layers are drawn in order starting from 0. Layer IDs don’t have to be sequential. Read more
Sets how a particular layer is blended with the underlying layer
Clears the current layer
Clears all of the layers (without resetting any other resources, as clear_canvas does)
Exchanges the contents of two layers in the drawing
Releases the resources used by the current sprite
Adds a sprite transform to the next sprite drawing operation
Renders a sprite with a set of transformations
Loads font data into the canvas for a particular font ID
Sets the size that text in the specified font will be rendered at
Draws a text string using a font
Draws specific glyphs from a font
Starts laying out a line of text
Adds text to the current line layout
Finishes laying out text and renders the result
Creates a new texture that can be used with fill_texture of the specified width and height
Sets the bitmap data for a texture, in the format specified by the call to create_texture()
Releases the memory allocated to a particular texture
Applies an alpha value to a texture
Defines a new gradient with a colour at stop position 0.0. Gradients can be used via fill_gradient()
Adds a new colour stop to a texture