CmdNumber
(Created page with "= <span class="f_Header">Action</span> = Draw a decimal number. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> </span> = <span cla...") |
|||
(2 intermediate revisions by one user not shown) | |||
Line 74: | Line 74: | ||
= <span class="f_Header">Example</span> = | = <span class="f_Header">Example</span> = | ||
+ | |||
+ | <source lang="bascomavr"> | ||
+ | ' Pseudocode | ||
+ | |||
+ | ' A number | ||
+ | CmdNumber 20, 60, 31, 0, 42 | ||
+ | </source> [[File:Clip0039.png|center|Clip0039.png]] | ||
+ | |||
+ | <source lang="bascomavr"> | ||
+ | ' Centered | ||
+ | CmdNumber 80, 60, 31, OPT_CENTER, 42 | ||
+ | </source> [[File:Clip0040.png|center|Clip0040.png]] | ||
+ | |||
+ | <source lang="bascomavr"> | ||
+ | ' Signed output of positive and negative numbers | ||
+ | CmdNumber 20, 20, 31, OPT_SIGNED, 42 | ||
+ | CmdNumber 20, 60, 31, OPT_SIGNED, -42 | ||
+ | </source> [[File:Clip0041.png|center|Clip0041.png]] | ||
+ | |||
+ | <source lang="bascomavr"> | ||
+ | ' Forcing width to 3 digits, right-justified | ||
+ | CmdNumber 150, 20, 31, OPT_RIGHTX OR 3, 42 | ||
+ | CmdNumber 150, 60, 31, OPT_SIGNED OR OPT_RIGHTX OR 3, -1 | ||
+ | </source> [[File:Clip0042.png|center|Clip0042.png]] | ||
+ | |||
+ | <br/>{{Languages}} | ||
+ | |||
+ | [[Category:FT800 Commands]] |
Latest revision as of 19:34, 12 December 2014
Contents |
Action
Draw a decimal number.
Syntax
CmdNumber x, y, font, options, n
Remarks
x |
x-coordinate of text base, in pixels |
y |
y-coordinate of text base, in pixels |
font |
font to use for text, 0-31. See ROM and RAM Fonts |
options |
By default (x,y) is the top-left pixel of the text. OPT_CENTERX centers the text horizontally OPT_CENTERY centers it vertically. OPT_CENTER centers the text in both directions. OPT_RIGHTX right-justifies the text, so that the x is the rightmost pixel. By default the number is displayed with no leading zeroes, but if a width 1-9 is specified in the options, then the number is padded if necessary with leading zeroes so that it has the given width. If OPT_SIGNED is given, the number is treated as signed, and prefixed by a minus sign if negative. |
n |
The number to display, either unsigned or signed 32-bit |
Example
' Pseudocode ' A number CmdNumber 20, 60, 31, 0, 42
' Centered CmdNumber 80, 60, 31, OPT_CENTER, 42
' Signed output of positive and negative numbers CmdNumber 20, 20, 31, OPT_SIGNED, 42 CmdNumber 20, 60, 31, OPT_SIGNED, -42
' Forcing width to 3 digits, right-justified CmdNumber 150, 20, 31, OPT_RIGHTX OR 3, 42 CmdNumber 150, 60, 31, OPT_SIGNED OR OPT_RIGHTX OR 3, -1
Languages | English |
---|