====== FillText (code : hex 1A) ====== |FillText baselineX baselineY text| Text를 표시합니다. M디스플레이는 < UTF-8유니코드> 를 지원합니다. 따라서 한글도 로 보내주어야 합니다. **EUC-KR (일명: 완성형코드)는 사용할 수 없습니다.** ^Argument ^Type ^Description^ |baselineX |Real Number |베이스라인의 X 좌표| |baselineY |Real Number |베이스라인의 Y 좌표| |text |Text |표시할 문자| |angle |Real Number |(Optional) 문자의 회전각| Clear # Draw yellow text in the default font Color FFFF00 FillText 100 100 "\"Hello\" in Korean is..." # Load font with Korean glyphs LoadFont "/gulim.ttf" # Draw green text in the gulim font Color 00FF00 FontSize 48 FillText 100 200 "안녕하세요" {{ :mdisplay:filltext_hex_1a:filltext1.png?nolink |}} ---- 같은 위치에서 계속 갱신되는 숫자를 표시하는 경우에는 고려해야될 사항이 있습니다.같은 위치에서 숫자를 다시 표시하면 아래 처럼 겹쳐져서 표시됩니다. # Green Rectangle Color 000800 FillRectangle 0 0 200 75 # White Text Color FFFFFF FillText 50 50 "123" FillText 50 50 "456" {{ :mdisplay:filltext_hex_1a:filltext2.png?nolink |}} 이를 피하기 위해, 해당 영역을 Clear한뒤 표시한다면, 검은색 바탕이 보이게 됩니다. # Green Rectangle Color 000800 FillRectangle 0 0 200 75 # White Text Color FFFFFF # Display "123" FillText 50 50 "123" # Clear the box containing the text (black on background layer) Clear 40 20 70 40 # Display "456" FillText 50 50 "456" {{ :mdisplay:filltext_hex_1a:filltext3.png?nolink |}} Layer기능을 이용하면 이 문제를 해결할 수 있습니다. 배경 Layer에는 지워서는 안될 배경화면을 그리고, 앞 Layer에 Text를 표시합니다. 앞 Layer를 Clear한뒤 다음 숫자를 표시하면, 화면에는 자연스럽게 갱신되는 숫자가 표시됩니다. # Green Rectangle Color 000800 FillRectangle 0 0 800 480 # New 70x40 layer, positioned at 40,20 to contain text CreateLayer 40 20 70 40 1 Layer 1 # White text Color FFFFFF # Display "123" # Coordinates are relative to new layer's top-left corner (i.e. 40,20) FillText 0 40 "123" # Erase "123" (Transparent for foreground layer) Clear # Display "456" FillText 0 40 "456" {{ :mdisplay:filltext_hex_1a:filltext4.png?nolink |}} [[mdisplay:index#그래픽_코멘드|M Display 메인페이지로 가기]]