17
02. Input/output 02. Input/output 한한한한한 한한한한한한 한한한 200897105 한한한 2008. Spring

02. Input/output

  • Upload
    italia

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Page 1: 02. Input/output

02. Input/output02. Input/output한신대학교 컴퓨터공학부 대학원

200897105 송기원2008. Spring

Page 2: 02. Input/output

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

Page 3: 02. Input/output

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

Page 4: 02. Input/output

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

Page 5: 02. Input/output

CodeCode

Page 6: 02. Input/output

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

Page 7: 02. Input/output

CodeCode

Page 8: 02. Input/output

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);

Page 9: 02. Input/output

CodeCode

Page 10: 02. Input/output

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”);

Page 11: 02. Input/output

CodeCode

Page 12: 02. Input/output

Output : TextOutput : Text

Custom font & text border◦Custom font◦Custom text border

Page 13: 02. Input/output

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

Page 14: 02. Input/output

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)

Page 15: 02. Input/output

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

Page 16: 02. Input/output

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

Page 17: 02. Input/output

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