CmdTranslate
From MCS Wiki AVR
(Difference between revisions)
(Created page with "= <span class="f_Header">Action</span> = Apply a translation to the current matrix. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> ...") |
|||
| Line 41: | Line 41: | ||
= <span class="f_Header">Example</span> = | = <span class="f_Header">Example</span> = | ||
| + | |||
| + | <source lang="bascomavr"> | ||
| + | ' Pseudocode | ||
| + | |||
| + | ' To translate the bitmap 20 pixels to the right | ||
| + | Begin_G BITMAPS | ||
| + | CmdLoadIdentity | ||
| + | CmdTranslate 20 * 65536, 0 | ||
| + | CmdSetMatrix | ||
| + | Vertex2II 68, 28, 0, 0 | ||
| + | </source>[[File:Clip0076.png|center|Clip0076.png]] | ||
| + | |||
| + | <source lang="bascomavr"> | ||
| + | ' To translate the bitmap 20 pixels to the left | ||
| + | Begin_G BITMAPS | ||
| + | CmdLoadIdentity | ||
| + | CmdTranslate -20 * 65536, 0 | ||
| + | CmdSetMatrix | ||
| + | Vertex2II 68, 28, 0, 0 | ||
| + | </source>[[File:Clip0077.png|center|Clip0077.png]] | ||
| + | |||
| + | <br/>{{Languages}} | ||
| + | |||
| + | [[Category:FT800 Commands]] | ||
Latest revision as of 19:37, 12 December 2014
Contents |
Action
Apply a translation to the current matrix.
Syntax
CmdTranslate tx, ty
Remarks
|
tx |
x translate factor, in signed 16.16 bit fixed-point form |
|
ty |
y translate factor, in signed 16.16 bit fixed-point form |
Example
' Pseudocode ' To translate the bitmap 20 pixels to the right Begin_G BITMAPS CmdLoadIdentity CmdTranslate 20 * 65536, 0 CmdSetMatrix Vertex2II 68, 28, 0, 0
' To translate the bitmap 20 pixels to the left Begin_G BITMAPS CmdLoadIdentity CmdTranslate -20 * 65536, 0 CmdSetMatrix Vertex2II 68, 28, 0, 0
| Languages | English |
|---|

