170 likes | 264 Views
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
E N D
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 • Input: Pad, Stylus, Keyboard • Pad • Stylus • Keyboard • Shape Recognition • PA Graffiti Contents
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
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
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
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
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
Custom font & text border • Custom font • Custom text border Output : Text
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
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
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
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
8bit vs 16c • 16c : Speed • 8bit : Functionalities • Conclusion • 16c will be both faster and smaller in VRAM • 16c Text Output : 8bit and 16c modes