Struct pixel_engine::Engine

source ·
pub struct Engine {
    pub title: String,
    pub size: (u32, u32, u32),
    pub elapsed: f64,
    /* private fields */
}
Expand description

Bone of the Engine, join everything;

Fields

title: String

Main title of the window, Window’s full title will be “Title - fps”

size: (u32, u32, u32)

Size of the window, with (x-size,y-size,pixel-size)

elapsed: f64

Time between current frame and last frame, usefull for movement’s calculations

Implementations

Return the current Target size in pixel

Get The status of a key

Get the status of a Mouse Button

Get the mouse location (in pixel) on the screen Will be defaulted to (0,0) at the start of the program

Get the scroll wheel direction (If Any) during the frame

Get all Keys pressed during the last frame

Create a GPU version of Sprite

Tell the GPU to destroy everything related to that [Decal]

Trait Implementations

Formats the value using the given formatter. Read more
Draw A decal with given position and uv (You probably don’t want to use this)
Draw a decal from the given position
Draw a decal with a given scale
Draw a partial decal from the given position
Draw a partial decal with a given scale
Draw a decal where all Corner are given, this will set the uv correctly to allow texture warping The points are in order: Read more
Draw a decal where all Corner are given, this will set the uv correctly to allow texture warping The points are in order: Read more
Draw a decal rotated angle radians around center center is an offset in pixel from the top left corner of the decal Read more
Same as draw_rotated_decal but with scaling
Draw a zone of a decal and rotate it
Draw a zone of a decal, rotate it and scaled it
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Same as the non tinted variant, but with an tint color parameter
Get the pixel at the given location, but bypassing any bounds check Read more
Set the pixel at the given location, but bypassing any bounds check Read more
Set the pixel data at the given coordinates to the given Color Will use the current PixelMode Read more
Clear the Sprite With the given Color
Get the size of the target
Set the PixelMode
Get the Pixel Data at the given coordinates
Set the Blend Factor Used for alpha calculations Read more
Get The textsheet (A Sprite)
Return the PixelMode
Get the Blend Factor Used for alpha calculations Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Draw a dotted line
Draw a rectangle with the top left corner at (x, y) and the bottom right corner at (x + w, y + h) (both inclusive) This is the dotted form Read more
Draw the edges of a triangle between the three points This is the dotted form Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Draw text to the screen scale must be >= 1 The textsize will be equal to scale * 8 for the height and scale * 8 * text.len() for the width This will handle \n treating it as a new line, but wont do any newline stuff if it is drawing out of the screen Read more
Draw a line between two points, You don’t need to do anything with the points for it to work, it will swap them it needed. Read more
Draw a rectangle with the top left corner at (x, y) and the bottom right corner at (x + w, y + h) (both inclusive) Read more
Fill a rectangle with the top left corner at (x, y) and the bottom right corner at (x + w, y + h) (both inclusive) Read more
Draw a circle with center (x, y) and raduis r
Fill a circle with center (x, y) and raduis r
Draw the edges of a triangle between the three points
Fill the given triangle
Draw a Sprite with the top left corner at (x, y) the flip arguement will allow fliping of the axis flip: (horizontal, vertical) scale is the scale of the result (must be >= 1) Read more
Draw a chunk of the given Sprite onto the Target coords is the top left corner of the Target o is the Top left corner of the Sprite Chunk and size is the (width, height) of the chunk flip and scale is the same as SpriteTrait::draw_sprite() Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.