[][src]Struct blaze_rs::static::StaticBatch

pub struct StaticBatch<'b, 't: 'b> { /* fields omitted */ }

Defines a static sprite batching object.

Designed for static geometry. The sprites are put into static VAO and use the same specified texture. Useful for static geometry like tilemaps, which do not change over time. It's possible to transform the geometry by supplying a transform matrix. The sprites are 'baked' into the GPU memory when they are first presented and cannot be modified afterwards.

Methods

impl<'b, 't: 'b> StaticBatch<'b, 't>[src]

pub fn new(options: StaticBatchOpts<'t>) -> Result<StaticBatch<'b, 't>, String>[src]

Creates a new StaticBatch using specified options.

pub fn draw(
    &self,
    position: Vector2,
    srcRectangle: Option<Rectangle>,
    rotationInRadians: f32,
    origin: Option<Vector2>,
    scale: Option<Vector2>,
    color: Color,
    flip: SpriteFlip
) -> CallResult
[src]

Pushes a sprite into the batch using the specified parameters. Returns error if the batch limits are reached.

Parameters

position - Position of the sprite (top-left corner if origin is NULL) srcRectangle - Part of the source texture to draw defined in pixels, or NULL if the whole texture should be drawn rotation - Rotation of the sprite in clockwise direction in radians origin - The point around which the sprite should be positioned and rotated, if NULL, top-left corner (0, 0) will be used scale - Scale in X and Y directions, if NULL, defaults to (1,1) color - Color to apply to the sprite (color gets multiplied if default shader is used) effects - Defines if the sprite should be flipped in any direction

pub fn lower_draw(&self, quad: &SpriteQuad) -> CallResult[src]

Lower-level drawing function, which allows specifying a custom quad to be drawn. Used internally by the library.

pub fn present(&self, transformMatrix: &[f32; 16]) -> CallResult[src]

Flushes the batch onto the screen, drawing everything.

pub fn get_options(&self) -> &StaticBatchOpts[src]

Returns options which were used when this object was created.

Trait Implementations

impl<'b, 't: 'b> Drop for StaticBatch<'b, 't>[src]

Auto Trait Implementations

impl<'b, 't> !Send for StaticBatch<'b, 't>

impl<'b, 't> !Sync for StaticBatch<'b, 't>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.