Struct oxygengine_prototype::resources::renderables::TextRenderable
source · pub struct TextRenderable {
pub transform: Transform2d,
pub content: HaTextContent,
pub font: String,
pub size: Scalar,
pub color: Rgba,
pub alignment: Vec2,
pub bounds_width: Option<Scalar>,
pub bounds_height: Option<Scalar>,
pub wrapping: HaTextWrapping,
}
Fields§
§transform: Transform2d
§content: HaTextContent
§font: String
§size: Scalar
§color: Rgba
§alignment: Vec2
§bounds_width: Option<Scalar>
§bounds_height: Option<Scalar>
§wrapping: HaTextWrapping
Implementations§
source§impl TextRenderable
impl TextRenderable
pub fn new(font: impl ToString, content: impl Into<HaTextContent>) -> Self
pub fn transform(self, value: Transform2d) -> Self
pub fn position(self, value: impl Into<Vec2>) -> Self
pub fn rotation(self, value: Scalar) -> Self
pub fn scale(self, value: impl Into<Vec2>) -> Self
pub fn content(self, value: impl Into<HaTextContent>) -> Self
pub fn font(self, value: impl ToString) -> Self
pub fn size(self, value: Scalar) -> Self
pub fn color(self, value: Rgba) -> Self
pub fn alignment(self, value: impl Into<Vec2>) -> Self
pub fn bounds_width(self, value: Option<Scalar>) -> Self
pub fn bounds_height(self, value: Option<Scalar>) -> Self
pub fn wrapping(self, value: HaTextWrapping) -> Self
pub fn to_text_instance(&self) -> HaTextInstance
Trait Implementations§
source§impl Clone for TextRenderable
impl Clone for TextRenderable
source§fn clone(&self) -> TextRenderable
fn clone(&self) -> TextRenderable
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TextRenderable
impl Debug for TextRenderable
source§impl Default for TextRenderable
impl Default for TextRenderable
source§impl From<TextRenderable> for Renderable
impl From<TextRenderable> for Renderable
source§fn from(other: TextRenderable) -> Self
fn from(other: TextRenderable) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for TextRenderable
impl Send for TextRenderable
impl Sync for TextRenderable
impl Unpin for TextRenderable
impl UnwindSafe for TextRenderable
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Initialize for Twhere
T: Default,
impl<T> Initialize for Twhere T: Default,
fn initialize(&mut self)
§unsafe fn initialize_raw(data: *mut ())
unsafe fn initialize_raw(data: *mut ())
Safety Read more