Struct pixel_engine::Engine [−][src]
pub struct Engine {
pub title: String,
pub size: (u32, u32, u32),
pub elapsed: f64,
// some fields omitted
}
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
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
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
fn draw_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P
)
fn draw_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P
)
Draw a partial decal from the given position
fn draw_partial_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P
)
fn draw_partial_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P
)
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
Auto Trait Implementations
impl !RefUnwindSafe for Engine
impl !UnwindSafe for Engine
Blanket Implementations
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 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
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