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

Function set_vlayout_spacing_padding

perro_editor/res/scripts/ui/editor_ui.rs:4292–4306  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    name: &str,
    spacing: f32,
    pad_x: f32,
    pad_top: f32,
    pad_bottom: f32,
)

Source from the content-addressed store, hash-verified

4290 let Some(color) = Color::from_hex(fill) else {
4291 return;
4292 };
4293 if let Some(id) = find_named(ctx, name) {
4294 let _ = with_node_mut!(ctx.run, UiButton, id, |node| {
4295 node.style.fill = color;
4296 });
4297 }
4298}
4299
4300pub fn set_panel_fill<API: ScriptAPI + ?Sized>(
4301 ctx: &mut ScriptContext<'_, API>,
4302 name: &str,
4303 fill: &str,
4304) {
4305 let Some(color) = Color::from_hex(fill) else {
4306 return;
4307 };
4308 if let Some(id) = find_named(ctx, name) {
4309 let _ = with_node_mut!(ctx.run, UiPanel, id, |node| {

Callers 2

Calls 1

find_namedFunction · 0.85

Tested by

no test coverage detected