Skip to main content

BasicShape

Trait BasicShape 

Source
pub trait BasicShape {
    // Required methods
    fn scale(&mut self, width: f32, height: f32) -> &mut Self;
    fn pos(&mut self, x: f32, y: f32) -> &mut Self;
    fn rotation(&mut self, rotation: f32) -> &mut Self;
    fn color(&mut self, red: f32, green: f32, blue: f32) -> &mut Self;
    fn color_from_color(&mut self, color: Color) -> &mut Self;
    fn layer(&mut self, layer: u16) -> &mut Self;
    fn to_instance(&self) -> Instance;
}

Required Methods§

Source

fn scale(&mut self, width: f32, height: f32) -> &mut Self

size of the shape

Source

fn pos(&mut self, x: f32, y: f32) -> &mut Self

location of the shape in the frame

Source

fn rotation(&mut self, rotation: f32) -> &mut Self

rotation of the shape in radians

Source

fn color(&mut self, red: f32, green: f32, blue: f32) -> &mut Self

fill color of the shape

Source

fn color_from_color(&mut self, color: Color) -> &mut Self

fill color of the shape

Source

fn layer(&mut self, layer: u16) -> &mut Self

render layer of the shape

higher layer -> foreground

Source

fn to_instance(&self) -> Instance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§