码迷,mamicode.com
首页 > 其他好文 > 详细

6. 显示文字

时间:2019-02-22 23:00:03      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:horizon   nes   uri   rda   cells   return   背景   idt   mamicode   

6.1 基本例程

GUI_DispString("Hello world!");

6.2 绘图模式

GUI_SetColor()         // 设置前景颜色
GUI_SetBkColor()      // 设置背景颜色
GUI_SetTextMode()    // 选择文字模式
  • Normal text    // GUI_TM_NORMAL 
  • Reverse text    // GUI_TM_NORMAL 
  • Transparent text   // GUI_TM_TRANS
  • XOR texttext   // GUI_TM_XOR

Example

GUI_SetFont(&GUI_Font8x16);
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
GUI_SetPenSize(10);
GUI_SetColor(GUI_RED);
GUI_DrawLine(80, 10, 240, 90);
GUI_DrawLine(80, 90, 240, 10);
GUI_SetBkColor(GUI_BLACK);
GUI_SetColor(GUI_WHITE);
GUI_SetTextMode(GUI_TM_NORMAL);
GUI_DispStringHCenterAt("GUI_TM_NORMAL" , 160, 10);
GUI_SetTextMode(GUI_TM_REV);
GUI_DispStringHCenterAt("GUI_TM_REV" , 160, 26);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_DispStringHCenterAt("GUI_TM_TRANS" , 160, 42);
GUI_SetTextMode(GUI_TM_XOR);
GUI_DispStringHCenterAt("GUI_TM_XOR" , 160, 58);
GUI_SetTextMode(GUI_TM_TRANS | GUI_TM_REV);
GUI_DispStringHCenterAt("GUI_TM_TRANS | GUI_TM_REV", 160, 74);

 Screenshot of above example

技术图片

 6.3  位置

GUI_GotoX()        
GUI_GotoY()
GUI_GotoXY()

 

 

6.4 文本API

 

Routine

Description

Displaying text

GUI_DispCEOL()

Clears the current line from the current position to the end.

GUI_DispChar()

Displays a single character.

GUI_DispCharAt()

Displays a single character at the specified position.

GUI_DispChars()

Displays a character a specified number of times.

GUI_DispString()

Displays a string.

GUI_DispStringAt()

Displays a string at the specified position.

GUI_DispStringAtCEOL()

Displays a string at the specified position and clears the cur-rent line to the end.

GUI_DispStringHCenterAt()

Displays a string centered horizontally at the given position.

GUI_DispStringInRect()

Displays a string in the specified rectangle.

GUI_DispStringInRectEx()

Displays a string rotated in the specified rectangle.

GUI_DispStringInRectWrap()

Displays a string wrapped in the specified rectangle.

GUI_DispStringinRectWrapEx()

Displays a string rotated and wrapped in the specified rectan-gle.

GUI_DispStringLen()

Displays a string at the current position with specified number of characters.

GUI_WrapGetNumLines()

Returns the number lines required to display the given stringusing the given wrap mode at the given size.

Drawing modes

GUI_GetTextMode()

Returns the currently set drawing mode.

GUI_SetTextMode()

Sets the drawing mode.

GUI_SetTextStyle()

Sets the style to be used.

GUI_SetClearTextRectMode()

Enables clear rect mode when displaying a string in a rectan-gle.

Alignment

GUI_GetTextAlign()

Returns the currently set text alignment.

GUI_SetLBorder()

Sets the size of the left border to be used after line feeds.

GUI_SetTextAlign()

Sets the text alignment.

Position

GUI_DispNextLine()

Moves the cursor to the beginning of the next line.

GUI_GotoX()

Sets the X-position.

GUI_GotoXY()

Sets the X- and Y-position.

GUI_GotoY()

Sets the Y-position.

GUI_GetDispPosX()

Returns the current X-position.

GUI_GetDispPosY()

Returns the current Y-position.

 

6. 显示文字

标签:horizon   nes   uri   rda   cells   return   背景   idt   mamicode   

原文地址:https://www.cnblogs.com/qiyuexin/p/10420877.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!