pub struct Macropix {
pub camera_position: Vec2,
/* private fields */
}
Fields§
§camera_position: Vec2
Implementations§
Source§impl Macropix
impl Macropix
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Examples found in repository?
examples/pixel.rs (line 6)
5async fn main() {
6 let mut pix = Macropix::new(100, 100);
7
8 loop {
9 let mouse_pos = pix.mouse_position();
10
11 pix.begin_draw();
12 clear_background(BLACK);
13 draw_circle_lines(mouse_pos.x, mouse_pos.y, 5.0, 1.0, WHITE);
14 pix.end_draw();
15
16 next_frame().await;
17 }
18}
Sourcepub fn mouse_position(&self) -> Vec2
pub fn mouse_position(&self) -> Vec2
Examples found in repository?
examples/pixel.rs (line 9)
5async fn main() {
6 let mut pix = Macropix::new(100, 100);
7
8 loop {
9 let mouse_pos = pix.mouse_position();
10
11 pix.begin_draw();
12 clear_background(BLACK);
13 draw_circle_lines(mouse_pos.x, mouse_pos.y, 5.0, 1.0, WHITE);
14 pix.end_draw();
15
16 next_frame().await;
17 }
18}
Sourcepub fn begin_draw(&mut self)
pub fn begin_draw(&mut self)
Examples found in repository?
examples/pixel.rs (line 11)
5async fn main() {
6 let mut pix = Macropix::new(100, 100);
7
8 loop {
9 let mouse_pos = pix.mouse_position();
10
11 pix.begin_draw();
12 clear_background(BLACK);
13 draw_circle_lines(mouse_pos.x, mouse_pos.y, 5.0, 1.0, WHITE);
14 pix.end_draw();
15
16 next_frame().await;
17 }
18}
Sourcepub fn end_draw(&mut self)
pub fn end_draw(&mut self)
Examples found in repository?
examples/pixel.rs (line 14)
5async fn main() {
6 let mut pix = Macropix::new(100, 100);
7
8 loop {
9 let mouse_pos = pix.mouse_position();
10
11 pix.begin_draw();
12 clear_background(BLACK);
13 draw_circle_lines(mouse_pos.x, mouse_pos.y, 5.0, 1.0, WHITE);
14 pix.end_draw();
15
16 next_frame().await;
17 }
18}
Auto Trait Implementations§
impl Freeze for Macropix
impl RefUnwindSafe for Macropix
impl Send for Macropix
impl Sync for Macropix
impl Unpin for Macropix
impl UnwindSafe for Macropix
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