pub struct TextConfig {Show 16 fields
pub position_size_config: Option<PositionSizeConfig>,
pub clip_rect: Option<Option<PositionSizeConfig>>,
pub hidden: Option<bool>,
pub ignore_render_layer: Option<bool>,
pub content: Option<String>,
pub font_size: Option<f32>,
pub color: Option<[u8; 3]>,
pub alpha: Option<u8>,
pub background_color: Option<[u8; 3]>,
pub background_alpha: Option<u8>,
pub background_rounding: Option<f32>,
pub font: Option<String>,
pub selectable: Option<bool>,
pub hyperlink_text: Option<Vec<(String, HyperlinkSelectMethod)>>,
pub auto_fit: Option<[bool; 2]>,
pub tags: Option<Vec<[String; 2]>>,
}Expand description
Config options for text resources.
文本资源的配置选项。
Fields§
§position_size_config: Option<PositionSizeConfig>Config for position, size, and layout.
位置、尺寸和布局配置。
clip_rect: Option<Option<PositionSizeConfig>>Optional clipping rectangle that defines the visible area.
定义可见区域的可选裁剪矩形。
Controls whether the text is visible or hidden.
控制文本是否可见或隐藏。
ignore_render_layer: Option<bool>If true, the text ignores render layer.
如果为true,文本忽略渲染层。
content: Option<String>Text content to be displayed.
要显示的文本内容。
font_size: Option<f32>Font size in points.
字体大小(点)。
color: Option<[u8; 3]>Text color as [R, G, B].
文本颜色,格式为[R, G, B]。
alpha: Option<u8>Opacity of the text (0-255).
文本的不透明度(0-255)。
background_color: Option<[u8; 3]>Background color behind the text as [R, G, B].
文本背后的背景颜色,格式为[R, G, B]。
background_alpha: Option<u8>Opacity of the background (0-255).
背景的不透明度(0-255)。
background_rounding: Option<f32>Radius for rounded corners of the background.
背景圆角半径。
font: Option<String>The font used for the specified text.
指定文本使用的字体。
selectable: Option<bool>Whether the text can be selected by the user.
文本是否可以被用户选择。
hyperlink_text: Option<Vec<(String, HyperlinkSelectMethod)>>Hyperlink texts for clickable regions.
可点击区域的超链接文本。
auto_fit: Option<[bool; 2]>Automatically adjust size to fit content.
自动调整尺寸以适应内容。
Key-value pairs for categorization and metadata.
用于分类和元数据的键值对标签。
Implementations§
Source§impl TextConfig
impl TextConfig
pub fn from_text(text: &Text) -> Self
pub fn position_size_config( self, position_size_config: Option<PositionSizeConfig>, ) -> Self
pub fn clip_rect(self, clip_rect: Option<Option<PositionSizeConfig>>) -> Self
pub fn ignore_render_layer(self, ignore_render_layer: Option<bool>) -> Self
pub fn content(self, content: Option<String>) -> Self
pub fn font_size(self, font_size: Option<f32>) -> Self
pub fn color(self, color: Option<[u8; 3]>) -> Self
pub fn alpha(self, alpha: Option<u8>) -> Self
pub fn background_color(self, background_color: Option<[u8; 3]>) -> Self
pub fn background_alpha(self, background_alpha: Option<u8>) -> Self
pub fn background_rounding(self, background_rounding: Option<f32>) -> Self
pub fn font(self, font: Option<String>) -> Self
pub fn selectable(self, selectable: Option<bool>) -> Self
pub fn hyperlink_text( self, hyperlink_text: Option<Vec<(String, HyperlinkSelectMethod)>>, ) -> Self
pub fn auto_fit(self, auto_fit: Option<[bool; 2]>) -> Self
Trait Implementations§
Source§impl Clone for TextConfig
impl Clone for TextConfig
Source§fn clone(&self) -> TextConfig
fn clone(&self) -> TextConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more