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

Function set_button_size

perro_editor/res/scripts/ui/editor_ui.rs:4780–4790  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    name: &str,
    size: (f32, f32),
)

Source from the content-addressed store, hash-verified

4778 });
4779 }
4780}
4781
4782pub fn set_ui_node_size<API: ScriptAPI + ?Sized>(
4783 ctx: &mut ScriptContext<'_, API>,
4784 name: &str,
4785 size: (f32, f32),
4786) {
4787 if let Some(id) = find_named(ctx, name) {
4788 let _ = with_base_node_mut!(ctx.run, UiNode, id, |node| {
4789 node.layout.size = UiVector2::ratio(size.0, size.1);
4790 });
4791 }
4792}
4793

Callers 2

Calls 1

find_namedFunction · 0.85

Tested by

no test coverage detected