pub struct RoomVisualExt {
pub room_visual: RoomVisual,
/* private fields */
}
Fields§
§room_visual: RoomVisual
Implementations§
Source§impl RoomVisualExt
impl RoomVisualExt
pub fn new(room_name: RoomName) -> Self
Sourcepub fn structure(
&mut self,
x: f32,
y: f32,
structure_type: StructureType,
opacity: f32,
)
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.
pub fn structure_roomxy( &mut self, xy: RoomXY, structure_type: StructureType, opacity: f32, )
Methods from Deref<Target = RoomVisual>§
pub fn draw(&self, visual: &Visual)
pub fn draw_multi(&self, visuals: &[Visual])
pub fn circle(&self, x: f32, y: f32, style: Option<CircleStyle>)
pub fn line(&self, from: (f32, f32), to: (f32, f32), style: Option<LineStyle>)
pub fn rect( &self, x: f32, y: f32, width: f32, height: f32, style: Option<RectStyle>, )
pub fn poly(&self, points: Vec<(f32, f32)>, style: Option<PolyStyle>)
pub fn text(&self, x: f32, y: f32, text: String, style: Option<TextStyle>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RoomVisualExt
impl RefUnwindSafe for RoomVisualExt
impl Send for RoomVisualExt
impl Sync for RoomVisualExt
impl Unpin for RoomVisualExt
impl UnwindSafe for RoomVisualExt
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