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

Function set_vlayout_h_align

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

Source from the content-addressed store, hash-verified

4266
4267pub fn set_text_box<API: ScriptAPI + ?Sized>(
4268 ctx: &mut ScriptContext<'_, API>,
4269 name: &str,
4270 text: &str,
4271) {
4272 let focused = with_state!(ctx.run, EditorState, ctx.id, |state| {
4273 state.focused_inspector_box == name
4274 }).unwrap_or_default();
4275 if focused {
4276 return;
4277 }
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 {

Callers 2

Calls 1

find_namedFunction · 0.85

Tested by

no test coverage detected