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

Function set_dropdown_options

perro_editor/res/scripts/ui/editor_ui.rs:4812–4842  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    name: &str,
    options: &[String],
    selected: &str,
)

Source from the content-addressed store, hash-verified

4810}
4811
4812pub fn set_vlayout_h_align<API: ScriptAPI + ?Sized>(
4813 ctx: &mut ScriptContext<'_, API>,
4814 name: &str,
4815 align: UiHorizontalAlign,
4816) {
4817 if let Some(id) = find_named(ctx, name) {
4818 let _ = with_node_mut!(ctx.run, UiVLayout, id, |node| {
4819 node.layout.h_align = align;
4820 });
4821 }
4822}
4823
4824pub fn set_hlayout_h_align<API: ScriptAPI + ?Sized>(
4825 ctx: &mut ScriptContext<'_, API>,
4826 name: &str,
4827 align: UiHorizontalAlign,
4828) {
4829 if let Some(id) = find_named(ctx, name) {
4830 let _ = with_node_mut!(ctx.run, UiHLayout, id, |node| {
4831 node.layout.h_align = align;
4832 });
4833 }
4834}
4835
4836pub fn set_vlayout_spacing_padding<API: ScriptAPI + ?Sized>(
4837 ctx: &mut ScriptContext<'_, API>,
4838 name: &str,
4839 spacing: f32,
4840 pad_x: f32,
4841 pad_top: f32,
4842 pad_bottom: f32,
4843) {
4844 if let Some(id) = find_named(ctx, name) {
4845 let _ = with_node_mut!(ctx.run, UiVLayout, id, |node| {

Callers 1

refresh_inspector_viewFunction · 0.85

Calls 4

find_namedFunction · 0.85
cloneMethod · 0.80
positionMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected