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

Function set_canvas_line

perro_editor/res/scripts/ui/editor_ui.rs:4510–4533  ·  view source on GitHub ↗
(
    ctx: &mut ScriptContext<'_, API>,
    name: &str,
    vertical: bool,
    offset: f32,
    origin: bool,
)

Source from the content-addressed store, hash-verified

4508) {
4509 if let Some(id) = find_named(ctx, name) {
4510 let _ = with_node_mut!(ctx.run, UiTextBox, id, |node| {
4511 node.padding = UiRect::symmetric(x, y);
4512 });
4513 }
4514}
4515
4516pub fn set_text_box_h_align<API: ScriptAPI + ?Sized>(
4517 ctx: &mut ScriptContext<'_, API>,
4518 name: &str,
4519 align: UiTextAlign,
4520) {
4521 if let Some(id) = find_named(ctx, name) {
4522 let _ = with_node_mut!(ctx.run, UiTextBox, id, |node| {
4523 node.h_align = align;
4524 });
4525 }
4526}
4527
4528pub fn set_text_box_padding_rect<API: ScriptAPI + ?Sized>(
4529 ctx: &mut ScriptContext<'_, API>,
4530 name: &str,
4531 padding: UiRect,
4532) {
4533 if let Some(id) = find_named(ctx, name) {
4534 let _ = with_node_mut!(ctx.run, UiTextBox, id, |node| {
4535 node.padding = padding;
4536 });

Callers 1

apply_viewport_canvasFunction · 0.85

Calls 1

find_namedFunction · 0.85

Tested by

no test coverage detected