(
ctx: &mut ScriptContext<'_, API>,
name: &str,
vertical: bool,
offset: f32,
origin: bool,
)
| 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 | |
| 4516 | pub 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 | |
| 4528 | pub 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 | }); |
no test coverage detected