pub struct Edges { /* private fields */ }Implementations§
source§impl Edges
impl Edges
sourcepub fn single_image_edge_translated(&self) -> Vec<Vec2>
pub fn single_image_edge_translated(&self) -> Vec<Vec2>
If there’s only one sprite / object in the image, this returns just one, with coordinates translated to either side of (0, 0)
sourcepub fn single_image_edge_raw(&self) -> Vec<Vec2>
pub fn single_image_edge_raw(&self) -> Vec<Vec2>
If there’s only one sprite / object in the image, this returns just one, with coordinates left alone and all in positive x and y
sourcepub fn multi_image_edge_translated(&self) -> Vec<Vec<Vec2>>
pub fn multi_image_edge_translated(&self) -> Vec<Vec<Vec2>>
If there’s more than one sprite / object in the image, this returns all it finds, with coordinates translated to either side of (0, 0)
sourcepub fn multi_image_edges_raw(&self) -> Vec<Vec<Vec2>>
pub fn multi_image_edges_raw(&self) -> Vec<Vec<Vec2>>
If there’s more than one sprite / object in the image, this returns all it finds, with coordinates left alone and all in positive x and y
sourcepub fn image_to_edges(&self, translate: bool) -> Vec<Vec<Vec2>>
pub fn image_to_edges(&self, translate: bool) -> Vec<Vec<Vec2>>
Takes a Bevy DynamicImage type and an boolean to indicate whether to translate the points you get back to either side of (0, 0) instead of everything in positive x and y
sourcepub fn march_edges(
&self,
data: &[usize],
rows: usize,
cols: usize,
translate: bool
) -> Vec<Vec<Vec2>>
pub fn march_edges( &self, data: &[usize], rows: usize, cols: usize, translate: bool ) -> Vec<Vec<Vec2>>
Marching squares adjacent, walks all the pixels in the provided data and keeps track of any that have at least one transparent / zero value neighbor then, while sorting into drawing order, groups them into sets of connected pixels
Accepts a flag indicating whether or not to translate coordinates to either side of (0,0) or leave it all in positive x,y