Type Definition ggez::graphics::Image
[−]
[src]
type Image = ImageGeneric<Resources>;
In-GPU-memory image data available to be drawn on the screen, using the OpenGL backend.
Methods
impl Image
[src]
fn new<P: AsRef<Path>>(context: &mut Context, path: P) -> GameResult<Image>
[src]
Load a new image from the file at the given path.
fn from_rgba8(
context: &mut Context,
width: u16,
height: u16,
rgba: &[u8]
) -> GameResult<Image>
[src]
context: &mut Context,
width: u16,
height: u16,
rgba: &[u8]
) -> GameResult<Image>
Creates a new Image
from the given buffer of u8
RGBA values.
fn solid(context: &mut Context, size: u16, color: Color) -> GameResult<Image>
[src]
A little helper function that creates a new Image that is just a solid square of the given size and color. Mainly useful for debugging.
fn width(&self) -> u32
[src]
Return the width of the image.
fn height(&self) -> u32
[src]
Return the height of the image.
fn get_filter(&self) -> FilterMode
[src]
Get the filter mode for the image.
fn set_filter(&mut self, mode: FilterMode)
[src]
Set the filter mode for the image.
fn get_dimensions(&self) -> Rect
[src]
Returns the dimensions of the image.
fn get_wrap(&self) -> (WrapMode, WrapMode)
[src]
Gets the Image
's WrapMode
along the X and Y axes.
fn set_wrap(&mut self, wrap_x: WrapMode, wrap_y: WrapMode)
[src]
Sets the Image
's WrapMode
along the X and Y axes.