Struct RoomVisualExt

Source
pub struct RoomVisualExt {
    pub room_visual: RoomVisual,
    /* private fields */
}

Fields§

§room_visual: RoomVisual

Implementations§

Source§

impl RoomVisualExt

Source

pub fn new(room_name: RoomName) -> Self

Source

pub fn structure( &mut self, x: f32, y: f32, structure_type: StructureType, opacity: f32, )

Draws given structure in the (x, y) tile with given opacity.

Arguments x and y should be integers to display the structure in the respective tile. Opacity 1.0 results in a fully opaque structure, 0.0 in a fully transparent. Using opacity smaller than 1.0 will result in mild visual glitches due to structure’s parts visually overlapping each other instead of the ones in the front hiding the ones behind. However, everything is still perfectly recognizable even at very low opacities. The roads connect to each other automatically. For the most game-like results, draw the roads before containers on them, and draw the ramparts after structures below them.

Source

pub fn structure_roomxy( &mut self, xy: RoomXY, structure_type: StructureType, opacity: f32, )

Methods from Deref<Target = RoomVisual>§

Source

pub fn draw(&self, visual: &Visual)

Source

pub fn draw_multi(&self, visuals: &[Visual])

Source

pub fn circle(&self, x: f32, y: f32, style: Option<CircleStyle>)

Source

pub fn line(&self, from: (f32, f32), to: (f32, f32), style: Option<LineStyle>)

Source

pub fn rect( &self, x: f32, y: f32, width: f32, height: f32, style: Option<RectStyle>, )

Source

pub fn poly(&self, points: Vec<(f32, f32)>, style: Option<PolyStyle>)

Source

pub fn text(&self, x: f32, y: f32, text: String, style: Option<TextStyle>)

Trait Implementations§

Source§

impl Deref for RoomVisualExt

Source§

type Target = RoomVisual

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.