Trait pixel_engine::traits::DecalDraw
source · pub trait DecalDraw {
Show 21 methods
fn draw_explicit_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
uv: [P; 4],
decal: &Decal,
tint: Color
);
fn draw_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
tint: Color
);
fn draw_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P,
tint: Color
);
fn draw_partial_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
tint: Color
);
fn draw_partial_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P,
tint: Color
);
fn draw_warped_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
decal: &Decal,
tint: Color
);
fn draw_warped_partial_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal,
tint: Color
);
fn draw_rotated_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
center: P,
angle: f32,
tint: Color
);
fn draw_rotated_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
center: P,
angle: f32,
scale: P,
tint: Color
);
fn draw_partial_rotated_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P,
tint: Color
);
fn draw_partial_rotated_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P,
scaled: P,
tint: Color
);
fn draw_decal<P: Into<Vf2d> + Copy>(&mut self, pos: P, decal: &Decal) { ... }
fn draw_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P
) { ... }
fn draw_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P
) { ... }
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_warped_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
decal: &Decal
) { ... }
fn draw_warped_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal
) { ... }
fn draw_rotated_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P
) { ... }
fn draw_rotated_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
scale: P
) { ... }
fn draw_partial_rotated_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P
) { ... }
fn draw_partial_rotated_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P,
scaled: P
) { ... }
}
Expand description
Draw Decals
Required Methods§
sourcefn draw_explicit_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
uv: [P; 4],
decal: &Decal,
tint: Color
)
fn draw_explicit_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
uv: [P; 4],
decal: &Decal,
tint: Color
)
Draw A decal with given position and uv (You probably don’t want to use this)
sourcefn draw_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
tint: Color
)
fn draw_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P,
tint: Color
)
fn draw_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_partial_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
tint: Color
)
fn draw_partial_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_partial_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P,
tint: Color
)
fn draw_partial_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_warped_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
decal: &Decal,
tint: Color
)
fn draw_warped_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
decal: &Decal,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_warped_partial_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal,
tint: Color
)
fn draw_warped_partial_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_rotated_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
center: P,
angle: f32,
tint: Color
)
fn draw_rotated_decal_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
center: P,
angle: f32,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
sourcefn draw_rotated_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
center: P,
angle: f32,
scale: P,
tint: Color
)
fn draw_rotated_decal_scaled_tinted<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
center: P,
angle: f32,
scale: P,
tint: Color
)
Same as the non tinted variant, but with an tint color parameter
Provided Methods§
sourcefn draw_decal<P: Into<Vf2d> + Copy>(&mut self, pos: P, decal: &Decal)
fn draw_decal<P: Into<Vf2d> + Copy>(&mut self, pos: P, decal: &Decal)
Draw a decal from the given position
sourcefn draw_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P
)
fn draw_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P
)
Draw a decal with a given scale
sourcefn 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
sourcefn 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
sourcefn draw_warped_decal<P: Into<Vf2d> + Copy>(&mut self, pos: [P; 4], decal: &Decal)
fn draw_warped_decal<P: Into<Vf2d> + Copy>(&mut self, pos: [P; 4], decal: &Decal)
Draw a decal where all Corner are given, this will set the uv correctly to allow texture warping The points are in order:
TopLeft
, BottomLeft
, BottomRight
, TopRight
sourcefn draw_warped_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal
)
fn draw_warped_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal
)
Draw a decal where all Corner are given, this will set the uv correctly to allow texture warping The points are in order:
TopLeft
, BottomLeft
, BottomRight
, TopRight
sourcefn draw_rotated_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P
)
fn draw_rotated_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P
)
Draw a decal rotated angle
radians around center
center is an offset in pixel from the top left corner of the decal
sourcefn draw_rotated_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
scale: P
)
fn draw_rotated_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
scale: P
)
Same as draw_rotated_decal
but with scaling