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 more