pub struct Text {
pub common: EntityCommon,
pub value: String,
pub insertion_point: Vector3,
pub alignment_point: Option<Vector3>,
pub height: f64,
pub rotation: f64,
pub width_factor: f64,
pub oblique_angle: f64,
pub style: String,
pub horizontal_alignment: TextHorizontalAlignment,
pub vertical_alignment: TextVerticalAlignment,
pub normal: Vector3,
}Expand description
A single-line text entity
Fields§
§common: EntityCommonCommon entity data
value: StringText content
insertion_point: Vector3Insertion point (first alignment point)
alignment_point: Option<Vector3>Second alignment point (for aligned/fit text)
height: f64Text height
rotation: f64Rotation angle in radians
width_factor: f64Width scale factor
oblique_angle: f64Oblique angle in radians
style: StringText style name
horizontal_alignment: TextHorizontalAlignmentHorizontal alignment
vertical_alignment: TextVerticalAlignmentVertical alignment
normal: Vector3Normal vector
Implementations§
Source§impl Text
impl Text
Sourcepub fn with_value(value: impl Into<String>, position: Vector3) -> Self
pub fn with_value(value: impl Into<String>, position: Vector3) -> Self
Create a new text with value and position
Sourcepub fn with_height(self, height: f64) -> Self
pub fn with_height(self, height: f64) -> Self
Set the text height
Sourcepub fn with_rotation(self, rotation: f64) -> Self
pub fn with_rotation(self, rotation: f64) -> Self
Set the rotation angle
Trait Implementations§
Source§impl Entity for Text
impl Entity for Text
Source§fn set_handle(&mut self, handle: Handle)
fn set_handle(&mut self, handle: Handle)
Set the entity’s handle
Source§fn line_weight(&self) -> LineWeight
fn line_weight(&self) -> LineWeight
Get the entity’s line weight
Source§fn set_line_weight(&mut self, weight: LineWeight)
fn set_line_weight(&mut self, weight: LineWeight)
Set the entity’s line weight
Source§fn transparency(&self) -> Transparency
fn transparency(&self) -> Transparency
Get the entity’s transparency
Source§fn set_transparency(&mut self, transparency: Transparency)
fn set_transparency(&mut self, transparency: Transparency)
Set the entity’s transparency
Source§fn is_invisible(&self) -> bool
fn is_invisible(&self) -> bool
Check if the entity is invisible
Source§fn set_invisible(&mut self, invisible: bool)
fn set_invisible(&mut self, invisible: bool)
Set the entity’s visibility
Source§fn bounding_box(&self) -> BoundingBox3D
fn bounding_box(&self) -> BoundingBox3D
Get the bounding box of the entity
Source§fn entity_type(&self) -> &'static str
fn entity_type(&self) -> &'static str
Get the entity type name
Source§fn apply_transform(&mut self, transform: &Transform)
fn apply_transform(&mut self, transform: &Transform)
Apply a general transform to the entity Read more
Source§fn apply_mirror(&mut self, transform: &Transform)
fn apply_mirror(&mut self, transform: &Transform)
Apply a mirror transform with entity-specific corrections Read more
Source§fn apply_rotation(&mut self, axis: Vector3, angle: f64)
fn apply_rotation(&mut self, axis: Vector3, angle: f64)
Apply rotation around an axis
Source§fn apply_scaling(&mut self, scale: f64)
fn apply_scaling(&mut self, scale: f64)
Apply uniform scaling
Source§fn apply_scaling_xyz(&mut self, scale: Vector3)
fn apply_scaling_xyz(&mut self, scale: Vector3)
Apply non-uniform scaling
Source§fn apply_scaling_with_origin(&mut self, scale: Vector3, origin: Vector3)
fn apply_scaling_with_origin(&mut self, scale: Vector3, origin: Vector3)
Apply scaling with a specific origin point
Source§fn mirror_about_line(&mut self, p1: Vector3, p2: Vector3)
fn mirror_about_line(&mut self, p1: Vector3, p2: Vector3)
Mirror the entity across a line defined by two points (in the XY plane)
Source§fn mirror_about_plane(&mut self, point: Vector3, normal: Vector3)
fn mirror_about_plane(&mut self, point: Vector3, normal: Vector3)
Mirror the entity across an arbitrary plane
impl StructuralPartialEq for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnsafeUnpin for Text
impl UnwindSafe for Text
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