[−][src]Struct bevy_svg_map::SvgStyle
Implementations
impl SvgStyle
[src]
Translater from SVG style (&str slice) to bevy (passing ) The string slice is parsed into a HashMap. Lazy accession to its values. Chief struct to implement the user-provided strategy to associate components/materials given the style of the path.
Except stroke_opacity() and fill_opacity() that return a Result
, all the types return an
Option<T>
. More properties could be exposed but these are enough for now to build things.
Example
use bevy_svg_map::SvgStyle; use bevy::prelude::Color; let style = SvgStyle::from("fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"); assert_eq!( style.stroke().unwrap(), Color { r: 0f32, g: 0f32, b: 0f32, a: 1f32 } );
pub fn stroke(&self) -> Option<Color>
[src]
pub fn fill(&self) -> Option<Color>
[src]
pub fn stroke_dashmap(&self) -> Option<NumberList>
[src]
pub fn stroke_opacity(&self) -> Result<f32, ParseFloatError>
[src]
In both opacities, please remember that they return a Result (it may change in the future)
let style = SvgStyle::from("fill:none;stroke:#000000;stroke-width:1.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5"); assert_eq!( style.stroke_opacity().unwrap(), 0.5 );
pub fn fill_opacity(&self) -> Result<f32, ParseFloatError>
[src]
pub fn stroke_width(&self) -> Option<f32>
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SvgStyle
impl Send for SvgStyle
impl Sync for SvgStyle
impl Unpin for SvgStyle
impl UnwindSafe for SvgStyle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> FromResources for T where
T: Default,
T: Default,
fn from_resources(_resources: &Resources) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,