Struct gemini_engine::elements::view::Point
source · pub struct Point {
pub pos: Vec2D,
pub fill_char: ColChar,
}
Expand description
Fields§
§pos: Vec2D
§fill_char: ColChar
Implementations§
source§impl Point
impl Point
sourcepub fn new(pos: Vec2D, fill_char: ColChar) -> Self
pub fn new(pos: Vec2D, fill_char: ColChar) -> Self
Examples found in repository?
examples/quick-start.rs (line 11)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
fn main() {
let mut view = View::new(40, 8, ColChar::BACKGROUND);
let mut point = Point::new(Vec2D { x: 10, y: 5 }, ColChar::SOLID);
loop {
view.clear();
point.pos.x += 1;
view.blit(&point, Wrapping::Wrap);
view.display_render().unwrap();
gameloop::sleep_fps(FPS, None);
}
}
Trait Implementations§
source§impl PartialEq<Point> for Point
impl PartialEq<Point> for Point
source§impl ViewElement for Point
impl ViewElement for Point
source§fn active_pixels(&self) -> Vec<Point>
fn active_pixels(&self) -> Vec<Point>
Return a vector of every coordinate where a pixel should be placed and its respective
ColChar
. If your whole object is a solid colour, consider using utils::points_to_pixels()
which will add the same ColChar
to every point and can then be used as this function’s outputimpl Copy for Point
impl Eq for Point
impl StructuralEq for Point
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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