Skip to main content

DrawableBuilder

Struct DrawableBuilder 

Source
pub struct DrawableBuilder { /* private fields */ }

Implementations§

Source§

impl DrawableBuilder

Source

pub fn new(name: String) -> Self

Trait Implementations§

Source§

impl DrawableBuilder for DrawableBuilder

Source§

fn base(&self) -> &DrawableBuilderBase

Source§

fn base_mut(&mut self) -> &mut DrawableBuilderBase

Source§

fn create_drawable(&self) -> UniqueDrawable

Create an instance of the appropriate drawable type
Source§

fn create_segment( &self, mode: DrawMode, segment: SegmentBase, ) -> UniqueDrawSegment

Create a segment wrapper
Source§

fn init(&mut self)

Setup the SDK-specific aspects after all the values are present
Source§

fn get_current_drawable( &mut self, create_if_none: bool, ) -> Option<&mut Box<dyn Drawable>>

Get the drawable we’re currently working on, if any
Source§

fn flush(&mut self, context: &(dyn Context + 'static))

Close the current drawable, using a new one for any further work
Source§

fn get_drawables(&self) -> &Vec<Box<dyn Drawable>>

Get all the completed drawables
Source§

fn clear_drawables(&mut self) -> Vec<Box<dyn Drawable>>

Get all the completed drawables and release ownership
Source§

fn get_drawable_id(&self) -> SimpleIdentity

Get the ID of the drawable we’re currently working on, if any
Source§

fn get_enabled(&self) -> bool

Source§

fn set_enabled(&mut self, value: bool)

Source§

fn get_render_pass(&self) -> RenderPass

Source§

fn set_render_pass(&mut self, value: RenderPass)

Source§

fn get_draw_priority(&self) -> i64

Source§

fn set_draw_priority(&mut self, value: i64)

Source§

fn get_sub_layer_index(&self) -> i32

Source§

fn set_sub_layer_index(&mut self, value: i32)

Source§

fn get_enable_depth(&self) -> bool

Source§

fn set_enable_depth(&mut self, value: bool)

Source§

fn get_depth_type(&self) -> DepthMaskType

Source§

fn set_depth_type(&mut self, value: DepthMaskType)

Source§

fn get_is_3d(&self) -> bool

Source§

fn set_is_3d(&mut self, value: bool)

Source§

fn reset_draw_priority(&mut self, value: i64)

Set the draw priority on all drawables including those already generated
Source§

fn get_line_width(&self) -> f32

Source§

fn set_line_width(&mut self, value: f32)

Source§

fn get_enable_color(&self) -> bool

Source§

fn set_enable_color(&mut self, value: bool)

Source§

fn get_enable_stencil(&self) -> bool

Source§

fn set_enable_stencil(&mut self, value: bool)

Source§

fn get_color_mode(&self) -> &ColorMode

Source§

fn set_color_mode(&mut self, value: &ColorMode)

Source§

fn get_cull_face_mode(&self) -> &CullFaceMode

Source§

fn set_cull_face_mode(&mut self, value: &CullFaceMode)

Source§

fn get_shader(&self) -> &Option<Rc<dyn ShaderProgramBase>>

Source§

fn set_shader(&mut self, value: Option<Rc<dyn ShaderProgramBase>>)

Source§

fn set_drawable_name(&mut self, value: String)

Set the name given to new drawables
Source§

fn set_vertex_attr_id(&mut self, id: usize)

The attribute id for vertex/position attribute
Source§

fn get_texture(&self, id: usize) -> Option<&Rc<RefCell<dyn Texture2D>>>

Source§

fn set_texture( &mut self, texture: Option<Rc<RefCell<dyn Texture2D>>>, id: usize, )

Source§

fn add_tweaker(&mut self, value: Rc<dyn DrawableTweaker>)

Source§

fn clear_tweakers(&mut self)

Source§

fn get_vertex_attributes(&self) -> Option<&Rc<RefCell<VertexAttributeArray>>>

Source§

fn set_vertex_attributes( &mut self, attrs: Option<Rc<RefCell<VertexAttributeArray>>>, )

Source§

fn get_instance_attributes(&self) -> Option<&Rc<RefCell<VertexAttributeArray>>>

Source§

fn set_instance_attributes( &mut self, attrs: Option<Rc<RefCell<VertexAttributeArray>>>, )

Source§

fn add_vertices( &mut self, vertices: &[[i16; 2]], vertex_offset: usize, vertex_length: usize, ) -> usize

Add some vertex elements, returns the index of the first one added
Source§

fn set_raw_vertices( &mut self, data: Vec<u8>, count: usize, type_: AttributeDataType, )

Provide raw data for vertices. Incompatible with adding primitives
Source§

fn set_segments( &mut self, mode: DrawMode, indexes: Vec<u16>, segments: &[SegmentBase], )

Set indexes and segments
Source§

fn set_segments_shared( &mut self, mode: DrawMode, indexes: Option<Rc<RefCell<IndexVectorBase>>>, segments: &[SegmentBase], )

Set shared indices and segments
Source§

fn add_triangle(&mut self, x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16)

Add a triangle
Source§

fn append_triangle(&mut self, x0: i16, y0: i16)

Add another triangle based on the previous two points
Source§

fn add_quad(&mut self, x0: i16, y0: i16, x1: i16, y1: i16)

Add a rectangle consisting of two triangles
Source§

fn add_lines( &mut self, indexes: &[u16], index_offset: usize, index_length: usize, base_index: usize, )

Add lines based on existing vertices
Source§

fn add_triangles( &mut self, indexes: &[u16], index_offset: usize, index_length: usize, base_index: usize, )

Add triangles based on existing vertices
Source§

fn add_polyline( &mut self, coordinates: &Vec<Point<i16>>, options: &PolylineGeneratorOptions, )

Add a polyline. If the last point equals the first it will be closed, otherwise open
Source§

fn setup_for_polylines(&mut self, context: &(dyn Context + 'static))

Impl::setupForPolylines(context, builder).
Source§

fn cur_vertex_count(&self) -> usize

return the current vertex count
Source§

fn empty(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>