CmdTranslate

Aus MCS Wiki AVR
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(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;"> ...")
 
 
Zeile 41: Zeile 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]]

Aktuelle Version vom 12. Dezember 2014, 20:37 Uhr

Inhaltsverzeichnis

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
Clip0076.png
' To translate the bitmap 20 pixels to the left
Begin_G BITMAPS
CmdLoadIdentity
CmdTranslate -20 * 65536, 0
CmdSetMatrix
Vertex2II 68, 28, 0, 0
Clip0077.png

Languages   English  
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Sprache