pub struct Image {Show 15 fields
pub basic_front_resource_config: BasicFrontResourceConfig,
pub position: [f32; 2],
pub size: [f32; 2],
pub display_info: DisplayInfo,
pub texture: Option<DebugTextureHandle>,
pub alpha: u8,
pub overlay_color: [u8; 3],
pub overlay_alpha: u8,
pub background_color: [u8; 3],
pub background_alpha: u8,
pub rotate_angle: f32,
pub rotate_center: [f32; 2],
pub image_load_method: ImageLoadMethod,
pub last_frame_path: String,
pub tags: Vec<[String; 2]>,
}Expand description
Image resource for displaying graphical content in the GUI.
用于在GUI中显示图形内容的图像资源。
Fields§
§basic_front_resource_config: BasicFrontResourceConfigConfig for basic front resource properties.
基本前端资源属性配置。
position: [f32; 2]Current display position of the image as [x, y].
图像的当前显示位置,坐标为[x, y]。
size: [f32; 2]Current display size of the image as [width, height].
图像的当前显示尺寸,为[width, height]。
display_info: DisplayInfoDisplay info controlling visibility and rendering.
显示信息,控制可见性和渲染。
texture: Option<DebugTextureHandle>Handle to the loaded texture, if available.
已加载纹理的句柄(如果可用)。
alpha: u8Opacity of the image (0-255).
图像的不透明度(0-255)。
overlay_color: [u8; 3]Color overlay applied to the image as [R, G, B].
应用于图像的色彩覆盖,格式为[R, G, B]。
overlay_alpha: u8Opacity of the overlay (0-255).
覆盖层的不透明度(0-255)。
background_color: [u8; 3]Background color behind the image as [R, G, B].
图像背后的背景颜色,格式为[R, G, B]。
background_alpha: u8Opacity of the background (0-255).
背景的不透明度(0-255)。
rotate_angle: f32Rotation angle of the image in degrees.
图像的旋转角度(度)。
rotate_center: [f32; 2]Center point for rotation, compare it with the actual size to obtain as [width, height].
旋转中心点,通过与实际大小的比得出,为[width, height]。
image_load_method: ImageLoadMethodMethod used to load the image.
用于加载图像的方法。
last_frame_path: StringThe path for loading the image in the previous frame.
上一帧加载图片的路径。
Key-value pairs for categorization and metadata.
用于分类和元数据的键值对标签。
Implementations§
Source§impl Image
impl Image
pub fn from_config(self, config: &ImageConfig) -> Self
pub fn basic_front_resource_config( self, basic_front_resource_config: &BasicFrontResourceConfig, ) -> Self
pub fn ignore_render_layer(self, ignore_render_layer: bool) -> Self
pub fn alpha(self, alpha: u8) -> Self
pub fn overlay_color(self, r: u8, g: u8, b: u8) -> Self
pub fn overlay_alpha(self, overlay_alpha: u8) -> Self
pub fn background_color(self, r: u8, g: u8, b: u8) -> Self
pub fn background_alpha(self, background_alpha: u8) -> Self
pub fn rotate_angle(self, rotate_angle: f32) -> Self
pub fn rotate_center(self, x: f32, y: f32) -> Self
pub fn image_load_method(self, image_load_method: &ImageLoadMethod) -> Self
Trait Implementations§
Source§impl BasicFrontResource for Image
impl BasicFrontResource for Image
Source§fn display_basic_front_resource_config(&self) -> BasicFrontResourceConfig
fn display_basic_front_resource_config(&self) -> BasicFrontResourceConfig
Source§fn display_position_size_config(&self) -> PositionSizeConfig
fn display_position_size_config(&self) -> PositionSizeConfig
Source§fn display_clip_rect(&self) -> Option<PositionSizeConfig>
fn display_clip_rect(&self) -> Option<PositionSizeConfig>
Source§fn display_position(&self) -> [f32; 2]
fn display_position(&self) -> [f32; 2]
Source§fn display_size(&self) -> [f32; 2]
fn display_size(&self) -> [f32; 2]
Source§fn modify_basic_front_resource_config(
&mut self,
basic_front_resource_config: BasicFrontResourceConfig,
)
fn modify_basic_front_resource_config( &mut self, basic_front_resource_config: BasicFrontResourceConfig, )
Source§fn modify_position_size_config(
&mut self,
position_size_config: PositionSizeConfig,
)
fn modify_position_size_config( &mut self, position_size_config: PositionSizeConfig, )
Source§fn modify_clip_rect(&mut self, clip_rect: Option<PositionSizeConfig>)
fn modify_clip_rect(&mut self, clip_rect: Option<PositionSizeConfig>)
Source§impl RustConstructorResource for Image
impl RustConstructorResource for Image
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Any for extract the specific type. Read moreSource§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Any for extract the specific type. Read moreSource§fn display_display_info(&self) -> Option<DisplayInfo>
fn display_display_info(&self) -> Option<DisplayInfo>
Source§fn modify_display_info(&mut self, display_info: DisplayInfo)
fn modify_display_info(&mut self, display_info: DisplayInfo)
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl !RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl !UnwindSafe for Image
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().