Struct elmesque::form::Form [−] [src]

pub struct Form {
    pub theta: f64,
    pub scale: f64,
    pub x: f64,
    pub y: f64,
    pub alpha: f32,
    pub form: BasicForm,
}

A general, freeform 2D graphics structure.

Fields

theta
scale
x
y
alpha
form

Methods

impl Form

fn shift(self, x: f64, y: f64) -> Form

Move a form by the given amount. this is a relative translation so shift(10.0, 10.0, form) would moveform` ten pixels up and ten pixels to the right.

fn shift_x(self, x: f64) -> Form

Move a shape in the x direction. This is relative so shift_x(10.0, form) moves form 10 pixels to the right.

fn shift_y(self, y: f64) -> Form

Move a shape in the y direction. This is relative so shift_y(10.0, form) moves `form upwards by 10 pixels.

fn scale(self, scale: f64) -> Form

Scale a form by a given factor. Scaling by 2 doubles both dimensions and quadruples the area.

fn rotate(self, theta: f64) -> Form

Rotate a form by a given angle. Rotate takes radians and turns things counterclockwise. So to turn form 30 degrees to the left you would say rotate(degrees(30), form).

fn alpha(self, alpha: f32) -> Form

Set the alpha of a Form. The default is 1 and 0 is totally transparent.

Trait Implementations

Derived Implementations

impl Debug for Form

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Form

fn clone(&self) -> Form

fn clone_from(&mut self, source: &Self)