MCPcopy Create free account
hub / github.com/PerroEngine/Perro / set_hlayout_h_align

Function set_hlayout_h_align

perro_editor/res/scripts/ui/editor_ui.rs:4280–4290  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    name: &str,
    align: UiHorizontalAlign,
)

Source from the content-addressed store, hash-verified

4278 if let Some(id) = find_named(ctx, name) {
4279 let text = text.to_string();
4280 let _ = with_node_mut!(ctx.run, UiTextBox, id, |node| {
4281 if node.text.as_ref() != text {
4282 node.set_text(text);
4283 }
4284 });
4285 }
4286}
4287
4288pub fn read_text_box<API: ScriptAPI + ?Sized>(
4289 ctx: &mut ScriptContext<'_, API>,
4290 name: &str,
4291) -> Option<String> {
4292 let id = find_named(ctx, name)?;
4293 Some(with_node!(ctx.run, UiTextBox, id, |node| node

Callers 1

Calls 1

find_namedFunction · 0.85

Tested by

no test coverage detected