Skip to main content

pite_core/nodes/
label.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! Label: draws text at its global position. `font_size` and `color` are
3//! inherited from `Control`.
4
5use crate::schema::{DefaultPropVal, NodeTypeSchema, PropHint, PropSchema};
6
7pub static SCHEMA: NodeTypeSchema = NodeTypeSchema {
8    type_name: "Label",
9    description: "Draws text centered on its global position.",
10    inherits: Some("Control"),
11    abstract_class: false,
12    props: PROPS,
13};
14
15pub static PROPS: &[PropSchema] = &[PropSchema {
16    key: "text",
17    label: "Text",
18    doc: "The string to draw. Empty text draws nothing.",
19    default_value: DefaultPropVal::Str(""),
20    hint: PropHint::Text,
21    read_only: false,
22}];