1 / 17

02. Input/output

02. Input/output. 한신대학교 컴퓨터공학부 대학원 200897105 송기원 2008. Spring. Output : Text Simple Text Box Text Advanced Text Displaying Integers Displaying Floats Displaying Strings Text Color PA_SetTextCol PA_SetTextTileCol %cX. Custom font & text border Custom font Custom text border

italia
Download Presentation

02. Input/output

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 02. Input/output 한신대학교 컴퓨터공학부 대학원 200897105 송기원 2008. Spring

  2. Output : Text • Simple Text • Box Text • Advanced Text • Displaying Integers • Displaying Floats • Displaying Strings • Text Color • PA_SetTextCol • PA_SetTextTileCol • %cX • Custom font & text border • Custom font • Custom text border • Input: Pad, Stylus, Keyboard • Pad • Stylus • Keyboard • Shape Recognition • PA Graffiti Contents

  3. Custom Shapes • Shape Infos • Output: 8bit and 16c modes • Understanding the basics • Advantages of the 16c/8bit • Font Sizes • Variable Width • Disadvantages • Low Speed… • No Auto-Erase • No Variable to Letters… • 8bit vs 16c… • 16c : Speed • 8bit : Functionnalities • Conclusion • 16c Text • Code Contents

  4. Initialization Text • PA_InitText • bool screen : screen (0: bottom, 1: top) • u8 bg select : background (0-3) • Simple Text • PA_OutputSimpleText • bool screen : screen • u16 x : x coordinate, in tiles(1-31) • u16 y : y coordinate, in tiles(1-23) • const char *text : text to output Output : Text

  5. Code

  6. Box Text • PA_BoxText • u8 screen : screen • u16 base x : top left corner x • u16 base y : top left corner y • u16 max x : bottom right corner x • u16 max y : bottom right corner y • const char *text : text to output • u32 limit : maximum letters to show Output : Text

  7. Code

  8. Advanced Text • Displaying Integers • The stylus’s position • Displaying Floats • Displaying Strings PA_OutputText (1, 0, 0,”Stylus X : %d”, Stylus.X); float test = 4.578; PA_OutputText (1, 0, 0,”Float value : %f3”, test); char name[10] = ”Mollusk”; PA_OutputText (1, 0, 0,”Hi %s”, name); Output : Text

  9. Code

  10. Text Color • PA_SetTextCol • PA_SetTextCol(screen, r, g, b) • values r is 0 to 31 (= g & b) • PA_SetTextTileCol • PA_SetTextTileCol(screen, i) • values 0 to 9 • %cX • values 0 to 9 PA_OutputText (1, 0, 0,”Color test %c1 Song”); Output : Text

  11. Code

  12. Custom font & text border • Custom font • Custom text border Output : Text

  13. Pad • Using the pad could hardly be easier • It is automatically updated every frame • The press type : • Held, Released, Newpress • Key • Arrow • ABXY key • left & right triggers • Start & select Input : Pad, Stylus, Keyboard

  14. Stylus • Held, Released, and Newpress • X and Y, used for the stylus’s position • Keyboard • Using Palib’s keyboard • Keyboard must be loaded on a given background (numbers 0 to 3) PA_InitKeyboard(background) PA_KeyboardIn(u16 x, u16 y) Input : Pad, Stylus, Keyboard

  15. Shape recognition • PA Graffiti • Customshapes • Shape Info • Adds informations to shape recognition. • Structure called PA_Recoinfo. • Contains • Length, startX, startY, endX, endY, minX, minY, maxX, maxY, Angle Input : Pad, Stylus, Keyboard

  16. Understanding the basics • Advantages of the 16c/8bit • Font Sizes • Variable Width • Disadvantages • Low Speed • No Auto-Erase • No Variable to Letters Output : 8bit and 16c modes

  17. 8bit vs 16c • 16c : Speed • 8bit : Functionalities • Conclusion • 16c will be both faster and smaller in VRAM • 16c Text Output : 8bit and 16c modes

More Related