pub enum Primitive {
Shadow(Shadow),
Quad(Quad),
Path(PaintedPath),
Underline(Underline),
MonochromeSprite(MonochromeSprite),
SubpixelSprite(SubpixelSprite),
PolychromeSprite(PolychromeSprite),
Surface(PaintSurface),
}Expand description
重导出场景系统相关类型 渲染图元 — 场景中所有可绘制元素的枚举。
Variants§
Shadow(Shadow)
阴影
Quad(Quad)
四边形
Path(PaintedPath)
矢量路径
Underline(Underline)
下划线
MonochromeSprite(MonochromeSprite)
单色精灵(灰度字形/图标)
SubpixelSprite(SubpixelSprite)
亚像素精灵(LCD 抗锯齿字形)
PolychromeSprite(PolychromeSprite)
多色精灵(彩色图像/Emoji)
Surface(PaintSurface)
平台原生绘制表面
Implementations§
Source§impl Primitive
impl Primitive
Sourcepub fn bounds(&self) -> &Bounds<ScaledPixels>
pub fn bounds(&self) -> &Bounds<ScaledPixels>
获取此图元的边界框。
Sourcepub fn content_mask(&self) -> &ContentMask<ScaledPixels>
pub fn content_mask(&self) -> &ContentMask<ScaledPixels>
获取此图元的内容裁剪蒙版。
Trait Implementations§
Source§impl From<MonochromeSprite> for Primitive
impl From<MonochromeSprite> for Primitive
Source§fn from(sprite: MonochromeSprite) -> Self
fn from(sprite: MonochromeSprite) -> Self
Converts to this type from the input type.
Source§impl From<PaintSurface> for Primitive
impl From<PaintSurface> for Primitive
Source§fn from(surface: PaintSurface) -> Self
fn from(surface: PaintSurface) -> Self
Converts to this type from the input type.
Source§impl From<PaintedPath> for Primitive
impl From<PaintedPath> for Primitive
Source§fn from(path: PaintedPath) -> Self
fn from(path: PaintedPath) -> Self
Converts to this type from the input type.
Source§impl From<PolychromeSprite> for Primitive
impl From<PolychromeSprite> for Primitive
Source§fn from(sprite: PolychromeSprite) -> Self
fn from(sprite: PolychromeSprite) -> Self
Converts to this type from the input type.
Source§impl From<SubpixelSprite> for Primitive
impl From<SubpixelSprite> for Primitive
Source§fn from(sprite: SubpixelSprite) -> Self
fn from(sprite: SubpixelSprite) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Send for Primitive
impl !Sync for Primitive
impl Forget for Primitive
impl Freeze for Primitive
impl Move for Primitive
impl RefUnwindSafe for Primitive
impl Unpin for Primitive
impl UnsafeUnpin for Primitive
impl UnwindSafe for Primitive
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more