TextDraw

Struct TextDraw 

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

Implementations§

Source§

impl TextDraw

Source

pub fn get_handle(&self) -> *const c_void

Source

pub fn new(handle: *const c_void) -> Self

Source

pub fn create(position: Vector2, text: &str) -> Option<TextDraw>

Creates a textdraw.

Source

pub fn destroy(&self) -> bool

Destroys a previously-created textdraw.

Source

pub fn is_shown_for_player(&self, player: &Player) -> bool

Source

pub fn set_letter_size(&self, size: Vector2) -> bool

Source

pub fn set_text_size(&self, size: Vector2) -> bool

Source

pub fn set_alignment(&self, alignment: TextDrawAlignmentTypes) -> bool

Source

pub fn set_color(&self, colour: Colour) -> bool

Source

pub fn use_box(&self, use_box: bool) -> bool

Toggle whether a textdraw uses a box or not.

Source

pub fn set_box_color(&self, colour: Colour) -> bool

Source

pub fn set_shadow(&self, size: i32) -> bool

Sets the size of a textdraw’s text’s shadow.

Source

pub fn set_outline(&self, size: i32) -> bool

Sets the thickness of a textdraw’s text’s outline.

Source

pub fn set_background_color(&self, colour: Colour) -> bool

Source

pub fn set_style(&self, font: TextDrawStyle) -> bool

Source

pub fn set_proportional(&self, set: bool) -> bool

Appears to scale text spacing to a proportional ratio.

Source

pub fn set_selectable(&self, set: bool) -> bool

Sets whether a textdraw can be selected (clicked on) or not.

Source

pub fn show_for_player(&self, player: &Player) -> bool

Shows a textdraw for a specific player.

Source

pub fn hide_for_player(&self, player: &Player) -> bool

Hides a textdraw for a specific player.

Source

pub fn show_for_all(&self) -> bool

Shows a textdraw for all players.

Source

pub fn hide_for_all(&self) -> bool

Hides a text draw for all players.

Source

pub fn set_string(&self, text: &str) -> bool

Changes the text on a textdraw.

Source

pub fn set_preview_model(&self, model: i32) -> bool

Set the model for a textdraw model preview.

Source

pub fn set_preview_rotation(&self, rotation: Vector3, zoom: f32) -> bool

Source

pub fn set_preview_veh_colour(&self, colour1: i32, colour2: i32) -> bool

Source

pub fn set_pos(&self, pos: Vector2) -> bool

Sets the position of a textdraw.

Source

pub fn get_string(&self) -> String

Gets the text of a textdraw.

Source

pub fn get_letter_size(&self) -> Vector2

Gets the width and height of the letters.

Source

pub fn get_text_size(&self) -> Vector2

Gets the X axis and Y axis of the textdraw.

Source

pub fn get_pos(&self) -> Vector2

Gets the position of a textdraw.

Source

pub fn get_color(&self) -> Colour

Gets the text color of a textdraw.

Source

pub fn get_box_color(&self) -> Colour

Gets the box color of a textdraw.

Source

pub fn get_background_color(&self) -> Colour

Gets the background color of a textdraw.

Source

pub fn get_shadow(&self) -> i32

Gets the size of a textdraw’s text’s shadow.

Source

pub fn get_outline(&self) -> i32

Gets the thickness of a textdraw’s text’s outline.

Source

pub fn get_style(&self) -> i32

Source

pub fn is_box(&self) -> bool

Checks if a textdraw is box.

Source

pub fn is_proportional(&self) -> bool

Checks if a textdraw is proportional.

Source

pub fn is_selectable(&self) -> bool

Checks if a textdraw is selectable.

Source

pub fn get_alignment(&self) -> TextDrawAlignmentTypes

Gets the text alignment of a textdraw.

Source

pub fn get_preview_model(&self) -> i32

Gets the preview model of a 3D preview textdraw.

Source

pub fn get_preview_rotation(&self) -> (Vector3, f32)

Source

pub fn get_preview_veh_colour(&self) -> (i32, i32)

Source

pub fn set_string_for_player(&self, player: &Player, text: &str) -> bool

Changes the text on a textdraw for a specific player.

Source

pub fn get_id(&self) -> i32

Source

pub fn from_id(id: i32) -> Option<TextDraw>

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> 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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.