[−][src]Struct duku::Target
Active render target.
Records rendering commands and settings. Received from the draw or draw_on_canvas functions.
Implementations
impl Target
[src]
pub fn background(&mut self, color: impl Into<Rgb>)
[src]
Set background color of canvas
pub fn fill(&mut self, color: impl Into<Rgb>)
[src]
Set fill color for shapes and text
pub fn stroke(&mut self, color: impl Into<Rgb>)
[src]
Set stroke color for borders and lines
pub fn tint(&mut self, color: impl Into<Rgb>)
[src]
Set tint color for meshes and textures
pub fn material(&mut self, m: &Handle<Material>)
[src]
Set material for meshes
pub fn no_material(&mut self)
[src]
Use default material for meshes
pub fn shader(&mut self, s: &Handle<Shader>)
[src]
Set shader for meshes
pub fn no_shader(&mut self)
[src]
Use default shader for meshes
pub fn skybox(&mut self, s: &Handle<Cubemap>)
[src]
Set skybox for rendering
pub fn font(&mut self, f: &Handle<Font>)
[src]
Set font for text
pub fn no_font(&mut self)
[src]
Use default font for text
pub fn shadows(&mut self)
[src]
Enable casting shadows for meshes
Uses the first directional light for casting the shadows.
pub fn no_shadows(&mut self)
[src]
Disable casting shadows for meshes
pub fn shadow_depth(&mut self, d: f32)
[src]
Set max shadow depth
pub fn shadow_split(&mut self, s: f32)
[src]
Set shadow split coefficient
0 to 1, higher values make closer shadows look better.
pub fn shadow_softness(&mut self, pcf: Pcf)
[src]
Set how soft shadows appear
pub fn light(&mut self, l: Light)
[src]
Add light to scene
Max is 4. When lights are full, removes first lights.
pub fn ambient(&mut self, color: impl Into<Rgbf>, brightness: f32)
[src]
Set the ambient light that affects the entire scene
pub fn exposure(&mut self, e: f32)
[src]
Set the exposure for tone mapping
pub fn stroke_weight(&mut self, w: f32)
[src]
Set the stroke weight for lines and borders
pub fn font_size(&mut self, s: u32)
[src]
Set font size for text
pub fn border_mode(&mut self, mode: BorderMode)
[src]
Set border mode
pub fn shape_mode(&mut self, mode: ShapeMode)
[src]
Set shape mode
pub fn filter(&mut self, f: Filter)
[src]
Set filter for textures
pub fn wrap(&mut self, w: Wrap)
[src]
Set wrap mode for textures
pub fn transform(&mut self, matrix: impl Into<Mat4>)
[src]
Transform points by matrix
pub fn reset_transform(&mut self)
[src]
Reset transform to default
pub fn translate(&mut self, v: impl Into<Vec3>)
[src]
Move transform by vector
pub fn translate_x(&mut self, x: f32)
[src]
Move transform on X axis
pub fn translate_y(&mut self, y: f32)
[src]
Move transform on Y axis
pub fn translate_z(&mut self, z: f32)
[src]
Move transform on Z axis
pub fn scale(&mut self, v: impl Into<Vec3>)
[src]
Scale transform by vector
pub fn rotate(&mut self, q: impl Into<Quat>)
[src]
Rotate transform by quaternion
pub fn rotate_x(&mut self, d: f32)
[src]
Rotate transform on the X axis
This angle is in degrees.
pub fn rotate_y(&mut self, d: f32)
[src]
Rotate transform on the Y axis
This angle is in degrees.
pub fn rotate_z(&mut self, d: f32)
[src]
Rotate transform on the Z axis
This angle is in degrees.
pub fn line(&mut self, p1: impl Into<Vec2>, p2: impl Into<Vec2>)
[src]
Draw a 2D line
pub fn lines(&mut self, points: &[Vec2])
[src]
Draw mitered 2D lines
pub fn mesh(&mut self, mesh: &Handle<Mesh>)
[src]
Draw a custom 3D mesh
pub fn wireframe(&mut self, mesh: &Handle<Mesh>)
[src]
Draw a wireframe for a 3D mesh
pub fn cube(&mut self, scale: impl Into<Vec3>)
[src]
Draw a scaled cube
pub fn sphere_uv(&mut self, scale: impl Into<Vec3>)
[src]
Draw a scaled uv sphere
pub fn sphere_ico(&mut self, scale: impl Into<Vec3>)
[src]
Draw a scaled ico sphere
pub fn plane(&mut self, scale: impl Into<Vec2>)
[src]
Draw a scaled plane
pub fn surface(&mut self, shader: &Handle<Shader>)
[src]
Draw a surface with a custom shader
pub fn fullscreen(&mut self, canvas: &Handle<Canvas>)
[src]
Draw a fullscreen canvas
pub fn model(&mut self, model: &Handle<Model>)
[src]
Draw all of the meshes of a model
pub fn debug_line<V: Into<Vec3>>(&mut self, p1: V, p2: V)
[src]
Draw a 3D debug line that isn't controlled by stroke_weight
pub fn debug_grid(&mut self)
[src]
Draw 3D guide grid for X and Z axis
pub fn text(&mut self, text: impl AsRef<str>, pos: impl Into<Vec2>)
[src]
Draw text string
pub fn shape(&mut self, points: &[Vec2])
[src]
Draw a custom shape from points
Shape must be convex
pub fn rect(&mut self, pos: impl Into<Vec2>, size: impl Into<Vec2>)
[src]
Draw a rectangle
pub fn square(&mut self, pos: impl Into<Vec2>, size: f32)
[src]
Draw a square
pub fn ellipse(&mut self, pos: impl Into<Vec2>, size: impl Into<Vec2>)
[src]
Draw an ellipse
pub fn circle(&mut self, pos: impl Into<Vec2>, size: f32)
[src]
Draw a circle
pub fn texture(
&mut self,
texture: &Handle<Texture>,
pos: impl Into<Vec2>,
size: impl Into<Vec2>
)
[src]
&mut self,
texture: &Handle<Texture>,
pos: impl Into<Vec2>,
size: impl Into<Vec2>
)
Draw a textured quad
pub fn texture_part(
&mut self,
texture: &Handle<Texture>,
pos: impl Into<Vec2>,
size: impl Into<Vec2>,
part_pos: impl Into<Vec2>,
part_size: impl Into<Vec2>
)
[src]
&mut self,
texture: &Handle<Texture>,
pos: impl Into<Vec2>,
size: impl Into<Vec2>,
part_pos: impl Into<Vec2>,
part_size: impl Into<Vec2>
)
Draw a quad with part of a texture
Part is defined in pixels
pub fn text_width(&self, text: impl AsRef<str>) -> f32
[src]
Get text width for current font
pub fn text_height(&self, text: impl AsRef<str>) -> f32
[src]
Get text height for current font
pub fn push(&mut self)
[src]
Save target settings to stack
pub fn pop(&mut self)
[src]
Restore target settings from stack
Auto Trait Implementations
impl RefUnwindSafe for Target
impl !Send for Target
impl !Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,