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: f64 scale: f64 x: f64 y: f64 alpha: f32 form: BasicForm

Methods

impl Form
[src]

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

impl Debug for Form
[src]

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

Formats the value using the given formatter.

impl Clone for Form
[src]

fn clone(&self) -> Form

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more