CmdTrack

From MCS Wiki AVR
Revision as of 20:29, 12 December 2014 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Action

Track touches for a graphics object.

 

 

Syntax

CmdTrack x, y, w, h, tag

 

 

Remarks

x

For linear tracker functionality, x-coordinate of track area top-left, in pixels.

For rotary tracker functionality, x-coordinate of track area center, in pixels.

y

For linear tracker functionality, y-coordinate of track area top-left, in pixels.

For rotary tracker functionality, y-coordinate of track area center, in pixels.

w

Width of track area, in pixels.

h

Height of track area, in pixels.

A w and h of (1,1) means that the tracker is rotary, and reports an, angle value in REG_TRACKER.

A w and h of  (0,0) disables the track functionality of co-processor engine.

tag

tag of the graphics object to be tracked, 1-255

 

This command will enable co-processor engine to track the touch on the particular graphics object with one valid tag value assigned.  Then, co-processor engine will update the REG_TRACKER periodically with the frame rate of LCD display panel.

Co-processor engine tracks the graphics object in rotary tracker mode and linear tracker mode:

 

Rotary tracker mode –  Track the angle between the touching point and the center of  graphics  object  specified  by  tag  value.

The value is in units of 1/65536 of a circle. 0 means that the angle is straight down, &H4000 left, &H8000 up, and &HC000 right

from the center.

 

Linear tracker mode –  If parameter w is greater than h, track the relative distance of touching point to the width of graphics

object specified by tag value. If parameter w is not greater than h, Track the  relative distance of touching point to the height of graphics object specified by tag value. The value is in units of  1/65536 of the width or height of graphics object.

The distance of  touching point refers to the distance from the top left pixel of graphics object to the coordinate of touching point.

 

 

Example

 

Note: see demo files for more examples

Personal tools
Namespaces
Variants
Actions
Navigation
Language