Post on 18-Jan-2016
description
02. Input/output02. Input/output한신대학교 컴퓨터공학부 대학원
200897105 송기원2008. Spring
ContentsContents
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
ContentsContents
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 TextCode
Output : TextOutput : Text
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
CodeCode
Output : TextOutput : 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
CodeCode
Output : TextOutput : 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);
CodeCode
Output : TextOutput : 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”);
CodeCode
Output : TextOutput : Text
Custom font & text border◦Custom font◦Custom text border
Input : Pad, Stylus, KeyboardInput : Pad, Stylus, Keyboard
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, KeyboardInput : 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, KeyboardInput : Pad, Stylus, Keyboard
Shape recognition◦PA Graffiti◦Custom shapes◦Shape Info
Adds informations to shape recognition. Structure called PA_Recoinfo. Contains
◦Length, startX, startY, endX, endY, minX, minY, maxX, maxY, Angle
Output : 8bit and 16c modesOutput : 8bit and 16c modes
Understanding the basicsAdvantages of the 16c/8bit
◦Font Sizes◦Variable Width
Disadvantages◦Low Speed◦No Auto-Erase◦No Variable to Letters
Output : 8bit and 16c modesOutput : 8bit and 16c modes
8bit vs 16c◦16c : Speed◦8bit : Functionalities◦Conclusion
16c will be both faster and smaller in VRAM16c Text