vanilladocs
vanillapunch.com
API / ui/uilabel

ui/uilabel

UI 라벨. (원본 ui/uilabel.js 의 UILabel)

  • 표시 전용 위젯. 호스트 content_size 영역 안에 정렬해 글자를 그린다. 세터는 원본처럼 글자 컴포넌트에 넘긴다.
  • 원본은 require() 로 호스트에 Text 와 RichText 를 붙이고 그 참조를 든다. 러스트 판은 RichText 하나를 품고, RichText 가 Text 를 품는다. (Sprite 가 Paint 를 품는 것과 같은 꼴) 씬 코드가 tick 밖에서 label.set_text 를 불러도 바로 반영되게 하려는 것이다. 형제 Text 를 두면 tick 안에서만 닿아 한 프레임 늦는다. 그래서 라벨 노드의 get_component::<Text>() 는 None 이다. 품은 Text 는 get_text_component / get_text_component_mut, RichText 는 get_rich_text_component / get_rich_text_component_mut 로 꺼낸다.
  • 원본은 Text 와 RichText 두 벌에 세터를 같이 걸고 use_rich_text 로 어느 쪽을 켤지 고른다. 러스트 판은 한 벌이라 맞출 일이 없다. use_rich_text(true) 면 RichText 로(마크업 해석), 아니면 품은 Text 로 그린다. append_segment / clear_segments 는 RichText 에 넘긴다.
  • 원본 setFont(FontFace) 는 set_font_family(등록한 폰트 이름) 로 바꿨다.
  • 글자 방향(set_text_direction)과 표시 글자 수(set_visible_character_count)는 원본처럼 글자 컴포넌트에 넘긴다.
  • 원본에서 옮기지 않은 것: invalidateIntrinsicContentSize (UINode 노선 전용).
  • 배경색(UIView)은 글자보다 먼저 그린다. (원본도 UILabel 이 require 한 Text, RichText 보다 앞 차례로 붙어 배경을 먼저 그린다)

UI label. (UILabel of the original ui/uilabel.js)

  • A display-only widget. Draws text aligned within the host's content_size area. Setters pass through to the text component as in the original.
  • The original attaches Text and RichText to the host with require() and holds their references. The Rust version embeds one RichText, and RichText embeds Text. (the same form as Sprite embedding Paint) This is so a label.set_text call from scene code outside tick takes effect immediately. A sibling Text would be reachable only inside tick and lag one frame. So get_component::<Text>() on a label node is None. The embedded Text is taken out with get_text_component / get_text_component_mut, and RichText with get_rich_text_component / get_rich_text_component_mut.
  • The original applies setters to both Text and RichText and picks which one to turn on with use_rich_text. The Rust version has a single set, so there is nothing to keep in sync. With use_rich_text(true) it draws with RichText (parsing markup), otherwise with the embedded Text. append_segment / clear_segments pass through to RichText.
  • The original setFont(FontFace) was changed to set_font_family (a registered font name).
  • Text direction (set_text_direction) and the visible character count (set_visible_character_count) pass through to the text component as in the original.
  • Not ported from the original: invalidateIntrinsicContentSize (UINode path only).
  • The background color (UIView) is drawn before the text. (in the original too, UILabel is attached ahead of the Text and RichText it requires, so the background is drawn first)

UILabelstruct traits Default, Component

짝Counterpart: vanilla.js UILabel소스source

UI 라벨.

  • RichText 를 품고(RichText 가 Text 를 품는다) 세터를 넘긴다. 호스트 content_size 영역 안에 정렬해 그리고, 배경색을 먼저 칠한다.

UI label.

  • Embeds RichText (RichText embeds Text) and passes the setters through. Draws aligned within the host's content_size area, painting the background color first.
예제Example노드에 붙인 점수 라벨A score label attached to a node
use vanilla::{NodeTree, Text, TextAlign, UILabel, Vector2};

let mut node_tree = NodeTree::new();
let root_id = node_tree.get_root_id();
let label_id = node_tree.create_child(root_id, "score");
node_tree[label_id].set_content_size(Vector2::create(240.0, 48.0));
let label = node_tree.add_component(label_id, UILabel::create_with_text("Score 0", 28.0)).unwrap();
label.set_text_color("#ffd166");
label.set_text_align(TextAlign::Left);
label.set_text("Score 120");
assert_eq!(label.get_text(), "Score 120");
assert_eq!(label.get_text_component().get_font_size(), 28.0);
assert!(node_tree[label_id].get_component::<Text>().is_none());
예제Example마크업으로 조각마다 다르게 그리기Draw each piece differently with markup
use vanilla::UILabel;

let mut label = UILabel::create_with_text("<b>Bold</b> and <color=red>red</color>", 24.0);
label.use_rich_text(true);
assert!(label.is_using_rich_text());
let segments = label.get_rich_text_component().get_segments();
assert_eq!(segments.len(), 3);
assert!(segments[0].attributes.is_bold);
assert_eq!(segments[2].text, "red");
생성자constructorpub fn new() -> UILabel#0.3.2 부터since 0.3.2소스source

생성. (글자 기본값은 Text 와 같다: 32px, 흰색, 가운데 정렬, 가운데 기준선)

Constructor. (text defaults are the same as Text: 32px, white, center aligned, middle baseline)

반환ReturnsUILabel 글이 빈 새 라벨. (리치텍스트 모드 꺼짐, content 노드는 트리에 붙일 때 만든다)New label with empty text. (rich text mode off, the content node is created when attached to a tree)

짝Counterpart: vanilla.js UILabel.constructor

정적staticpub fn create_with_text(text: &str, font_size: f64) -> UILabel#0.3.2 부터since 0.3.2소스source

글과 크기로 생성.

Constructor with text and size.

text&str
보일 글. (마크업을 풀어 두지만 use_rich_text(true) 일 때만 조각으로 그린다)Text to show. (markup is parsed ahead, but drawn as segments only when use_rich_text(true))
font_sizef64
글자 크기. (픽셀)Font size. (pixels)

반환ReturnsUILabel 그 글과 크기의 새 라벨.New label with that text and size.

메서드methodpub fn get_uiview(&self) -> &UIView#0.3.2 부터since 0.3.2소스source

품은 뷰 반환.

Returns the embedded view.

반환Returns&UIView 품은 UIView 의 참조.Reference to the embedded UIView.

메서드methodpub fn get_uiview_mut(&mut self) -> &mut UIView#0.3.2 부터since 0.3.2소스source

품은 뷰 반환. (변경용)

Returns the embedded view. (mutable)

반환Returns&mut UIView 품은 UIView 의 바꿀 수 있는 참조.Mutable reference to the embedded UIView.

메서드methodpub fn get_content(&self) -> Option<NodeId>#0.3.2 부터since 0.3.2소스source

컨텐트 노드 핸들.

Content node handle.

반환ReturnsOption<NodeId> content 노드. 트리에 붙기 전이면 None.content node. None before being attached to a tree.

짝Counterpart: vanilla.js UIView.getContent

메서드methodpub fn set_background_color(&mut self, background_color: impl Into<Color>)#0.3.2 부터since 0.3.2소스source

배경색 설정.

Sets the background color.

background_colorimpl Into<Color>
배경색. (글자보다 먼저 그린다, 알파가 0 이면 칠하지 않는다)Background color. (drawn before the text, not painted if alpha is 0)

짝Counterpart: vanilla.js UIView.setBackgroundColor

메서드methodpub fn get_background_color(&self) -> Color#0.3.2 부터since 0.3.2소스source

배경색 반환.

Returns the background color.

반환ReturnsColor 배경색. (기본은 알파 0 인 흰색)Background color. (default is white with alpha 0)

짝Counterpart: vanilla.js UIView.getBackgroundColor

메서드methodpub fn get_text_component(&self) -> &Text#0.3.2 부터since 0.3.2소스source

품은 글자 컴포넌트 반환. (원본의 node.get_component(Text) 자리)

Returns the embedded text component. (in place of the original node.get_component(Text))

반환Returns&Text 품은 Text 의 참조. (품은 RichText 안의 것)Reference to the embedded Text. (the one inside the embedded RichText)

메서드methodpub fn get_text_component_mut(&mut self) -> &mut Text#0.3.2 부터since 0.3.2소스source

품은 글자 컴포넌트 반환. (변경용)

Returns the contained text component. (mutable)

반환Returns&mut Text 품은 Text 의 바꿀 수 있는 참조.Mutable reference to the embedded Text.

메서드methodpub fn get_rich_text_component(&self) -> &RichText#0.3.2 부터since 0.3.2소스source

품은 리치텍스트 컴포넌트 반환. (원본의 node.get_component(RichText) 자리)

Returns the embedded rich text component. (in place of the original node.get_component(RichText))

반환Returns&RichText 품은 RichText 의 참조.Reference to the embedded RichText.

메서드methodpub fn get_rich_text_component_mut(&mut self) -> &mut RichText#0.3.2 부터since 0.3.2소스source

품은 리치텍스트 컴포넌트 반환. (변경용)

Returns the embedded rich text component. (mutable)

반환Returns&mut RichText 품은 RichText 의 바꿀 수 있는 참조.Mutable reference to the embedded RichText.

메서드methodpub fn append_segment(&mut self, text: &str, attributes: RichTextAttributes) -> &mut UILabel#0.3.2 부터since 0.3.2소스source

리치텍스트 조각 하나 더하기. (use_rich_text(true) 일 때 보인다)

Adds one rich text segment. (shown when use_rich_text(true))

text&str
조각 글. (마크업을 풀지 않는다)Segment text. (markup is not parsed)
attributesRichTextAttributes
조각의 꾸밈. (정하지 않은 칸은 라벨의 값을 따른다)Segment styling. (fields not set follow the label's values)

반환Returns&mut UILabel 이어 부를 수 있게 이 라벨.This label, for chaining.

짝Counterpart: vanilla.js UILabel.appendSegment

예제Example코드로 조각을 이어 쌓기Stack segments in code one after another
use vanilla::{RichTextAttributes, UILabel};

let mut label = UILabel::new();
label.use_rich_text(true);
let mut bold_attributes = RichTextAttributes::new();
bold_attributes.is_bold = true;
label.append_segment("Level ", RichTextAttributes::new()).append_segment("3", bold_attributes);
assert_eq!(label.get_rich_text_component().get_segments().len(), 2);
label.clear_segments();
assert!(label.get_rich_text_component().get_segments().is_empty());
메서드methodpub fn clear_segments(&mut self)#0.3.2 부터since 0.3.2소스source

리치텍스트 조각 모두 지우기.

Clears all rich text segments.

짝Counterpart: vanilla.js UILabel.clearSegments

메서드methodpub fn use_rich_text(&mut self, use_rich_text: bool)#0.3.2 부터since 0.3.2소스source

리치텍스트 모드 설정. (true 면 마크업을 풀어 조각마다 다르게 그린다)

Sets the rich text mode. (if true, parses markup and draws each segment differently)

use_rich_textbool
true 면 품은 RichText 로(조각마다), false 면 품은 Text 로 그린다.If true, draws with the embedded RichText (per segment), if false, with the embedded Text.

짝Counterpart: vanilla.js UILabel.useRichText

메서드methodpub fn is_using_rich_text(&self) -> bool#0.3.2 부터since 0.3.2소스source

리치텍스트 모드 여부.

Whether rich text mode is on.

반환Returnsbool 리치텍스트 모드면 true.true if in rich text mode.

짝Counterpart: vanilla.js UILabel.isUsingRichText

메서드methodpub fn set_text(&mut self, text: &str)#0.3.2 부터since 0.3.2소스source

글 설정.

Sets the text.

text&str
새 글. (리치텍스트 모드가 아니고 지금 글과 같으면 건너뛴다, 마크업은 늘 풀어 조각으로 둔다)New text. (skipped if not in rich text mode and the same as the current text, markup is always parsed into segments)

짝Counterpart: vanilla.js UILabel.setText

메서드methodpub fn get_text(&self) -> &str#0.3.2 부터since 0.3.2소스source

글 반환.

Returns the text.

반환Returns&str 지금 글. (마크업이 든 원래 글)Current text. (the original text with markup)

짝Counterpart: vanilla.js UILabel.getText

메서드methodpub fn set_fit_width(&mut self, width: f64, minimum_ratio: f64)#0.4.0 부터since 0.4.0소스source

한 줄 글을 너비에 맞추기 설정. (품은 Text 의 set_fit_width, 리치텍스트 모드는 맞추지 않는다)

Sets fitting single-line text to a width. (set_fit_width of the embedded Text, rich text mode does not fit)

widthf64
맞출 너비. (픽셀, 0 이하면 맞추지 않는다)Width to fit. (pixels, no fitting if 0 or less)
minimum_ratiof64
글자 크기를 줄일 수 있는 가장 작은 비율. (0 ~ 1 로 자른다)Minimum ratio the font size can shrink to. (clamped to 0 ~ 1)

짝Counterpart: vanilla.js UILabel.setFitWidth

예제Example단추 칸 180 픽셀에 맞추되 60% 아래로는 줄이지 않기Fit to a 180 pixel button slot but do not shrink below 60%
use vanilla::UILabel;

let mut label = UILabel::create_with_text("Start", 32.0);
label.set_fit_width(180.0, 0.6);
assert_eq!(label.get_fit_width(), 180.0);
assert_eq!(label.get_font_size(), 32.0);
label.set_fit_width(-5.0, 0.6);
assert_eq!(label.get_fit_width(), 0.0);
메서드methodpub fn get_fit_width(&self) -> f64#0.4.0 부터since 0.4.0소스source

맞출 너비 반환. (0 이면 맞추지 않는다)

Returns the width to fit. (no fitting if 0)

반환Returnsf64 맞출 너비. (픽셀, 0 이면 맞추지 않는다)Width to fit. (pixels, no fitting if 0)

짝Counterpart: vanilla.js UILabel.getFitWidth

메서드methodpub fn calculate_fitted_font_size(&mut self, graphic: &mut Graphic) -> f64#0.4.0 부터since 0.4.0소스source

그릴 때의 크기를 그 자리에서 재어 반환.

Measures and returns the drawn size on the spot.

graphic&mut Graphic
글을 잴 그래픽.Graphic to measure the text with.

반환Returnsf64 그릴 때의 글자 크기. (픽셀, 맞출 너비를 넘치면 줄인 크기)Font size when drawn. (pixels, the shrunk size if it overflows the fit width)

짝Counterpart: vanilla.js UILabel.calculateFittedFontSize

메서드methodpub fn measure_text(&self, graphic: &Graphic, text: &str, font_size: f64) -> f64#0.4.0 부터since 0.4.0소스source

글의 너비 재기. (품은 Text 의 measure_text)

Measures the width of text. (measure_text of the embedded Text)

graphic&Graphic
글을 잴 그래픽.Graphic to measure the text with.
text&str
잴 글. (라벨의 글과 따로)Text to measure. (separate from the label's text)
font_sizef64
잴 글자 크기. (픽셀)Font size to measure with. (pixels)

반환Returnsf64 글의 너비. (픽셀, 빈 글이면 0)Width of the text. (pixels, 0 for empty text)

짝Counterpart: vanilla.js UILabel.measureText

메서드methodpub fn get_fitted_font_size(&self) -> f64#0.4.0 부터since 0.4.0소스source

그릴 때의 크기 반환. (마지막으로 그리거나 잰 때의 값)

Returns the drawn size. (the value from the last draw or measurement)

반환Returnsf64 그릴 때의 글자 크기. (픽셀, 아직 배치를 다시 재지 않았으면 정한 크기)Font size when drawn. (pixels, the set size if the layout has not been remeasured yet)

짝Counterpart: vanilla.js UILabel.getFittedFontSize

메서드methodpub fn set_font_size(&mut self, font_size: f64)#0.3.2 부터since 0.3.2소스source

글자 크기 설정.

Sets the font size.

font_sizef64
글자 크기. (픽셀)Font size. (pixels)

짝Counterpart: vanilla.js UILabel.setFontSize

메서드methodpub fn get_font_size(&self) -> f64#0.3.2 부터since 0.3.2소스source

글자 크기 반환.

Returns the font size.

반환Returnsf64 정한 글자 크기. (픽셀, 맞춰 줄여도 그대로)The set font size. (pixels, unchanged even when shrunk to fit)

짝Counterpart: vanilla.js UILabel.getFontSize

메서드methodpub fn set_font_family(&mut self, font_family: &str)#0.3.2 부터since 0.3.2소스source

폰트 이름 설정. (원본 setFont 자리. Graphic 에 등록한 이름, 없으면 기본 폰트)

Sets the font name. (in place of the original setFont. a name registered with Graphic, the default font if none)

font_family&str
폰트 이름. (Graphic 에 등록한 이름)Font name. (a name registered with Graphic)
메서드methodpub fn get_font_family(&self) -> &str#0.3.2 부터since 0.3.2소스source

폰트 이름 반환.

Returns the font name.

반환Returns&str 폰트 이름.Font name.

메서드methodpub fn set_word_wrap_width(&mut self, word_wrap_width: f64)#0.3.2 부터since 0.3.2소스source

자동 줄바꿈 폭 설정. (0 이면 줄바꿈 문자로만 나눈다)

Sets the word wrap width. (0 splits only at newline characters)

word_wrap_widthf64
자동 줄바꿈 폭. (픽셀, 0 이면 줄바꿈 문자로만 나눈다)Word wrap width. (pixels, 0 splits only at newline characters)

짝Counterpart: vanilla.js UILabel.setWordWrapWidth

메서드methodpub fn set_wrap_mode(&mut self, wrap_mode: TextWrapMode)#0.4.0 부터since 0.4.0소스source

줄바꿈 방식 설정. (원본 setWrapMode, Word 또는 Character)

Sets the wrap mode. (original setWrapMode, Word or Character)

wrap_modeTextWrapMode
줄바꿈 방식. (Word 는 낱말 단위, Character 는 글자 단위)Wrap mode. (Word wraps by words, Character by characters)

짝Counterpart: vanilla.js UILabel.setWrapMode

메서드methodpub fn get_wrap_mode(&self) -> TextWrapMode#0.4.0 부터since 0.4.0소스source

줄바꿈 방식 반환.

Returns the wrap mode.

반환ReturnsTextWrapMode 줄바꿈 방식.Wrap mode.

짝Counterpart: vanilla.js UILabel.getWrapMode

메서드methodpub fn set_line_spacing(&mut self, line_spacing: f64)#0.3.2 부터since 0.3.2소스source

줄 간격 배율 설정.

Sets the line spacing multiplier.

line_spacingf64
줄 간격. (글자 크기의 배수)Line spacing. (multiple of the font size)

짝Counterpart: vanilla.js UILabel.setLineSpacing

메서드methodpub fn set_letter_spacing(&mut self, letter_spacing: f64)#0.4.0 부터since 0.4.0소스source

글자 간격 설정. (CSS letter-spacing 과 같은 뜻, 원본 setLetterSpacing)

Sets the letter spacing. (same meaning as CSS letter-spacing, original setLetterSpacing)

letter_spacingf64
글자 묶음마다 뒤에 더하는 간격. (픽셀, 음수는 좁힘, 기본 0)Spacing added after each grapheme cluster. (pixels, negative narrows, default 0)

짝Counterpart: vanilla.js UILabel.setLetterSpacing

메서드methodpub fn get_letter_spacing(&self) -> f64#0.4.0 부터since 0.4.0소스source

글자 간격 반환.

Returns the letter spacing.

반환Returnsf64 글자 간격. (픽셀, 기본 0)Letter spacing. (pixels, default 0)

짝Counterpart: vanilla.js UILabel.getLetterSpacing

메서드methodpub fn set_visible_character_count(&mut self, visible_character_count: i32)#0.4.0 부터since 0.4.0소스source

보일 글자 수 설정. (-1 이면 전체, 타자기 연출용. 원본 setVisibleCharacterCount)

Sets the visible character count. (-1 for all, for typewriter effects. original setVisibleCharacterCount)

visible_character_counti32
보일 글자 수. (-1 이면 전체, -1 아래는 -1 로 맞춘다. 마크업이 든 글은 자르지 않는다)Visible character count. (-1 for all, below -1 is set to -1. text with markup is not cut)

짝Counterpart: vanilla.js UILabel.setVisibleCharacterCount

메서드methodpub fn get_visible_character_count(&self) -> i32#0.4.0 부터since 0.4.0소스source

보일 글자 수 반환.

Returns the visible character count.

반환Returnsi32 보일 글자 수. (-1 이면 전체)Visible character count. (-1 for all)

짝Counterpart: vanilla.js UILabel.getVisibleCharacterCount

메서드methodpub fn set_stroke_color(&mut self, color: impl Into<Color>)#0.3.2 부터since 0.3.2소스source

외곽선 색 설정.

Sets the outline color.

colorimpl Into<Color>
외곽선 색.Stroke color.

짝Counterpart: vanilla.js UILabel.setStrokeColor

메서드methodpub fn set_stroke_width(&mut self, stroke_width: f64)#0.3.2 부터since 0.3.2소스source

외곽선 두께 설정.

Sets the outline thickness.

stroke_widthf64
외곽선 두께. (픽셀, 0 이면 외곽선 없음)Outline thickness. (pixels, 0 for no outline)

짝Counterpart: vanilla.js UILabel.setStrokeWidth

메서드methodpub fn set_text_color(&mut self, color: impl Into<Color>)#0.3.2 부터since 0.3.2소스source

글자 색 설정.

Sets the text color.

colorimpl Into<Color>
글자 색. (Color 나 "#rrggbb" 같은 글)Text color. (a Color or text like "#rrggbb")

짝Counterpart: vanilla.js UILabel.setTextColor

메서드methodpub fn get_text_color(&self) -> Color#0.3.2 부터since 0.3.2소스source

글자 색 반환.

Returns the text color.

반환ReturnsColor 글자 색.Text color.

짝Counterpart: vanilla.js UILabel.getTextColor

메서드methodpub fn set_bold(&mut self, is_bold: bool)#0.3.2 부터since 0.3.2소스source

굵게 설정.

Sets bold.

is_boldbool
true 면 굵게.If true, bold.

짝Counterpart: vanilla.js UILabel.setBold

메서드methodpub fn is_bold(&self) -> bool#0.3.2 부터since 0.3.2소스source

굵게 여부.

Whether bold.

반환Returnsbool 굵게면 true.true if bold.

짝Counterpart: vanilla.js UILabel.isBold

메서드methodpub fn set_italic(&mut self, is_italic: bool)#0.3.2 부터since 0.3.2소스source

기울임 설정.

Sets italic.

is_italicbool
true 면 기울임.If true, italic.

짝Counterpart: vanilla.js UILabel.setItalic

메서드methodpub fn is_italic(&self) -> bool#0.3.2 부터since 0.3.2소스source

기울임 여부.

Whether italic.

반환Returnsbool 기울임이면 true.true if italic.

짝Counterpart: vanilla.js UILabel.isItalic

메서드methodpub fn set_underline(&mut self, is_underline: bool)#0.4.0 부터since 0.4.0소스source

밑줄 설정.

Sets underline.

is_underlinebool
true 면 밑줄.If true, underlined.

짝Counterpart: vanilla.js UILabel.setUnderline

메서드methodpub fn is_underline(&self) -> bool#0.4.0 부터since 0.4.0소스source

밑줄 여부.

Whether underlined.

반환Returnsbool 밑줄이면 true.true if underlined.

짝Counterpart: vanilla.js UILabel.isUnderline

메서드methodpub fn set_strikethrough(&mut self, is_strikethrough: bool)#0.4.0 부터since 0.4.0소스source

취소선 설정.

Sets strikethrough.

is_strikethroughbool
true 면 취소선.If true, strikethrough.

짝Counterpart: vanilla.js UILabel.setStrikethrough

메서드methodpub fn is_strikethrough(&self) -> bool#0.4.0 부터since 0.4.0소스source

취소선 여부.

Whether strikethrough.

반환Returnsbool 취소선이면 true.true if strikethrough.

짝Counterpart: vanilla.js UILabel.isStrikethrough

메서드methodpub fn set_text_direction(&mut self, text_direction: TextDirection)#0.4.0 부터since 0.4.0소스source

글자 방향 설정. (Inherit | Ltr | Rtl | Auto, 원본 setTextDirection. Inherit 면 그리는 때의 Graphic 방향)

Sets the text direction. (Inherit | Ltr | Rtl | Auto, original setTextDirection. Inherit uses the Graphic direction at draw time)

text_directionTextDirection
글자 방향.Text direction.

짝Counterpart: vanilla.js UILabel.setTextDirection

메서드methodpub fn get_text_direction(&self) -> TextDirection#0.4.0 부터since 0.4.0소스source

글자 방향 반환.

Returns the text direction.

반환ReturnsTextDirection 글자 방향.Text direction.

짝Counterpart: vanilla.js UILabel.getTextDirection

메서드methodpub fn set_text_align(&mut self, text_align: TextAlign)#0.3.2 부터since 0.3.2소스source

가로 정렬 설정.

Sets the horizontal alignment.

text_alignTextAlign
content 영역 안의 가로 정렬.Horizontal alignment within the content area.

짝Counterpart: vanilla.js UILabel.setTextAlign

메서드methodpub fn get_text_align(&self) -> TextAlign#0.3.2 부터since 0.3.2소스source

가로 정렬 반환.

Returns the horizontal alignment.

반환ReturnsTextAlign 가로 정렬.Horizontal alignment.

짝Counterpart: vanilla.js UILabel.getTextAlign

메서드methodpub fn set_text_baseline(&mut self, text_baseline: TextBaseline)#0.3.2 부터since 0.3.2소스source

세로 기준선 설정.

Sets the vertical baseline.

text_baselineTextBaseline
content 영역 안의 세로 기준선.Vertical baseline within the content area.

짝Counterpart: vanilla.js UILabel.setTextBaseline

메서드methodpub fn get_text_baseline(&self) -> TextBaseline#0.3.2 부터since 0.3.2소스source

세로 기준선 반환.

Returns the vertical baseline.

반환ReturnsTextBaseline 세로 기준선.Vertical baseline.

짝Counterpart: vanilla.js UILabel.getTextBaseline