Struct pixel_engine::Engine

source ·
pub struct Engine {
    pub title: String,
    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 You can modify it to change the title

§elapsed: f64

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

Implementations§

Return the current Target size in pixel

Return the pixel scale factor

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

Get all the keys that were held during the last frame

Get all the keys that were released during the last frame

Create a GPU version of Sprite

Will clear the input buffer and set the cursor to 0

Set the input buffer to the desired value and put the input cursor at the end of the text

Warning

The value must be an ascii string

Insert the given string into the input buffer at the input cursor

Warning

if the string is not only ASCII characters it will silently do nothing

Append the given string onto the input buffer

Warning

if the string is not only ASCII characters it will silently do nothing

Add keys onto the input pass through list

Remove keys onto the input pass through list

Set the input to the iterator

If set to true, any key that is passed through when in input mode won’t have the char appended to the input buffer

Return a view into the input buffer

Return the input cursor

Switch to text input mode, return true if it wasn’t in this mode before

This will clear the input buffer, reset the input cursor and stop the input mode

Is the engine in input mode

Stop the input mode right there, and return a &str to the current buffer. This is if you need to leave the mode but retain the input buffer for a later re-entry

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
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
Draw the given string starting at the position given and scaled
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
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
Get The textsheet (A Sprite)
Return the PixelMode
Get the Blend Factor Used for alpha calculations

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
Draw the edges of a triangle between the three points This is the dotted form

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
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.
Draw a rectangle with the top left corner at (x, y) and the bottom right corner at (x + w, y + h) (both inclusive)
Fill a rectangle with the top left corner at (x, y) and the bottom right corner at (x + w, y + h) (both inclusive)
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)
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()
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.