CmdSpinner

From MCS Wiki AVR
(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span class="f_Header">Action</span> = Start an animated spinner. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> </span> = <span...")
 
 
Line 79: Line 79:
  
 
= <span class="f_Header">Example</span> =
 
= <span class="f_Header">Example</span> =
 +
 +
<source lang="bascomavr">
 +
' Pseudocode
 +
 +
' Create a display list, then start the spinner
 +
Clear_B 1,1,1
 +
CmdText 80, 30, 27, OPT_CENTER, "Please wait..."
 +
CmdSpinner 80, 60, 0, 0
 +
</source>[[File:Clip0056.png|center|Clip0056.png]]
 +
 +
<source lang="bascomavr">
 +
' Spinner style 0, a circle of dots
 +
CmdSpinner 80, 60, 0, 0
 +
</source>[[File:Clip0057.png|center|Clip0057.png]]
 +
 +
<source lang="bascomavr">
 +
' Style 1, a line of dots
 +
CmdSpinner 80, 60, 1, 0
 +
</source>[[File:Clip0058.png|center|Clip0058.png]]
 +
 +
<source lang="bascomavr">
 +
' Style 2, a rotating clock hand
 +
CmdSpinner 80, 60, 2, 0
 +
</source>[[File:Clip0059.png|center|Clip0059.png]]
 +
 +
<source lang="bascomavr">
 +
' Style 3, two orbiting dots
 +
CmdSpinner 80, 60, 3, 0
 +
</source>[[File:Clip0060.png|center|Clip0060.png]]
 +
 +
<source lang="bascomavr">
 +
' Half screen, scale 1
 +
CmdSpinner 80, 60, 0, 1
 +
</source>[[File:Clip0061.png|center|Clip0061.png]]
 +
 +
<source lang="bascomavr">
 +
' Full screen, scale 2
 +
CmdSpinner 80, 60, 0, 2
 +
</source>[[File:Clip0062.png|center|Clip0062.png]]
 +
 +
{{Languages}}
 +
 +
[[Category:FT800 Commands]]

Latest revision as of 20:13, 12 December 2014

Contents

Action

Start an animated spinner.

 

 

Syntax

CmdSpinner x, y, style, range

 

 

Remarks

x

The X coordinate of top left of spinner

y

The Y coordinate of top left of spinner

style

The style of spinner. Valid range is from 0 to 3

range

The scaling coefficient of spinner. 0 means no scaling

 

The spinner is an animated overlay that shows the user that some task is continuing. To trigger  the  spinner,  create  a  display  list  and then use CMD_SPINNER. The co-processor engine overlays the spinner on the current display list, swaps the  display list to make it

visible, then continuously animates until it receives CMD_STOP. REG_MACRO_0 and REG_MACRO_1  registers are utilized to perform the  animation kind of effect. The frequency of points movement is with respect to the display frame rate configured.

 

Typically for 480x272 display panels the display rate is ~60fps.

 

For style 0 and 60fps the point repeats the sequence within 2 seconds.

For style 1 and 60fps the point repeats the  sequence within 1.25 seconds.

For style 2 and 60fps the clock hand repeats the sequence within 2 seconds.

For style 3 and 60fps the moving dots repeat the sequence within 1 second.

 

Note that only one of CmdSketchCmdScreenSaver or CmdSpinner can be active at one time.

 

 

 

Example

' Pseudocode
 
' Create a display list, then start the spinner
Clear_B 1,1,1
CmdText 80, 30, 27, OPT_CENTER, "Please wait..."
CmdSpinner 80, 60, 0, 0
Clip0056.png
' Spinner style 0, a circle of dots
CmdSpinner 80, 60, 0, 0
Clip0057.png
' Style 1, a line of dots
CmdSpinner 80, 60, 1, 0
Clip0058.png
' Style 2, a rotating clock hand
CmdSpinner 80, 60, 2, 0
Clip0059.png
' Style 3, two orbiting dots
CmdSpinner 80, 60, 3, 0
Clip0060.png
' Half screen, scale 1
CmdSpinner 80, 60, 0, 1
Clip0061.png
' Full screen, scale 2
CmdSpinner 80, 60, 0, 2
Clip0062.png
Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language