Struct conrod::widget::primitive::line::Line [] [src]

pub struct Line {
    pub common: CommonBuilder,
    pub start: Point,
    pub end: Point,
    pub style: Style,
    pub should_centre_points: bool,
}

A simple, non-interactive widget for drawing a single straight Line.

Fields

Data necessary and common for all widget builder types.

The start of the line.

The end of the line.

Unique styling.

Whether or not the line should be automatically centred to the widget position.

Methods

impl Line
[src]

Build a new Line widget with the given style.

Build a new default Line widget.

Build a new Line whose bounding box is fit to the absolute co-ordinates of the line points.

If you would rather centre the start and end to the middle of the bounding box, use Line::centred instead.

The same as Line::abs but with the given style.

Build a new Line and shift the location of the start and end points so that the centre of their bounding rectangle lies at the position determined by the layout for the Line widget.

This is useful if your points simply describe the line's angle and magnitude, and you want to position them using conrod's auto-layout or Positionable methods.

If you would rather centre the bounding box to the points, use Line::abs instead.

The same as Line::centred but with the given style.

The thickness or width of the Line.

Use this instead of Positionable::width for the thickness of the Line, as width and height refer to the dimensions of the bounding rectangle.

Make a solid line.

Make a line with a Dashed pattern.

Make a line with a Dotted pattern.

Trait Implementations

impl Copy for Line
[src]

impl Clone for Line
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Line
[src]

Formats the value using the given formatter.

impl Widget for Line
[src]

State to be stored within the Uis widget cache. Read more

Every widget is required to have its own associated Style type. This type is intended to contain high-level styling information for the widget that can be optionally specified by a user of the widget. Read more

The type of event yielded by the widget, returned via the Widget::set function. Read more

Return the initial State of the Widget. Read more

Return the styling of the widget. Read more

Update the state of the Line.

The default Position for the widget along the x axis. Read more

The default Position for the widget along the y axis. Read more

The default width for the Widget. Read more

The default height of the widget. Read more

If the widget is draggable, implement this method and return the position and dimensions of the draggable space. The position should be relative to the center of the widget. Read more

The area on which child widgets will be placed when using the Place Position methods.

Set the parent widget for this Widget by passing the WidgetId of the parent. Read more

Specify that this widget has no parent widgets.

Set whether or not the Widget should be placed on the kid_area. Read more

Indicates that the Widget is used as a non-interactive graphical element for some other widget. Read more

Set whether or not the widget is floating (the default is false). A typical example of a floating widget would be a pop-up or alert window. Read more

Indicates that all widgets who are children of this widget should be cropped to the kid_area of this widget. Read more

Makes the widget's KidArea scrollable. Read more

Makes the widget's KidArea scrollable. Read more

Set whether or not the widget's KidArea is scrollable (the default is false). Read more

A builder method that "lifts" the Widget through the given build function. Read more

A builder method that mutates the Widget with the given mutate function. Read more

A method that conditionally builds the Widget with the given build function. Read more

A method that optionally builds the the Widget with the given build function. Read more

Note: There should be no need to override this method. Read more

impl Colorable for Line
[src]

Set the color of the widget.

Set the color of the widget from rgba values.

Set the color of the widget from rgb values.

Set the color of the widget from hsla values.

Set the color of the widget from hsl values.