Top | < Previous (Errors) | Next (PAGE NAME) >
This is a list of constants available in SmileBASIC as of version 3.6.0.
Constants for the console text color. To be used in conjuction with COLOR.
Constant Name | Color | Value |
---|---|---|
#TBLACK | Black | 1 |
#TBLUE | Blue | 9 |
#TCYAN | Cyan | 13 |
#TGRAY | Gray | 14 |
#TLIME | Lime | 5 |
#TMAGENTA | Magenta | 11 |
#TMAROON | Maroon | 2 |
#TNAVY | Navy Blue | 8 |
#TOLIVE | Olive | 6 |
#TPURPLE | Purple | 10 |
#TRED | Red | 3 |
#TTEAL | Teal | 12 |
#TWHITE | White | 15 |
#TYELLOW | Yellow | 7 |
These are constants for onscreen graphics for SmileBASIC. These can be explicitly set in methods like GCOLOR.
Constant Name | Color | RGB Value | Real Value |
---|---|---|---|
#AQUA | Aqua | RGB(0, 248, 248) | -16713480 |
#BLACK | Black | RGB(0, 0, 0) | -16777216 |
#BLUE | Blue | RGB(0, 0, 248) | -16776968 |
#CYAN | Cyan | RGB(0, 248, 248) | -16713480 |
#FUCHSIA | Fuchsia | RGB(248, 0, 248) | -524040 |
#GRAY | Gray | RGB(128, 128, 128) | -8355712 |
#GREEN | Green | RGB(0, 128, 0) | -1674448 |
#LIME | Lime | RGB(0, 248, 0) | -16713728 |
#MAGENTA | Magenta | RGB(248, 0, 248) | -524040 |
#MAROON | Maroon | RGB(128, 0, 0) | -8388608 |
#NAVY | Navy blue | RGB(0, 0, 128) | -16777088 |
#OLIVE | Olive | RGB(128, 128, 0) | -8355840 |
#PURPLE | Purple | RGB(128, 0, 128) | -8388480 |
#RED | Red | RGB(248, 0, 0) | -524288 |
#SILVER | Silver | RGB(192, 192, 192) | -4144960 |
#TEAL | Teal | RGB(0, 128, 128) | -16744320 |
#WHITE | White | RGB(248, 248, 248) | -460552 |
#YELLOW | Yellow | RGB(248, 248, 0) | -460800 |
When getting values from BUTTON(), these constants can be used to easily identify the IDs of the buttons.
VAR X% = BUTTON()
' Detect if the A button is currently being pushed down using #A.
IF X% AND #A THEN PRINT "A button is being pushed down."
Constant Name | Button | Value |
---|---|---|
#A | A | 16 |
#B | B | 32 |
#X | X | 64 |
#Y | Y | 128 |
#L | L | 256 |
#R | R | 512 |
#UP | Up on D-pad | 1 |
#DOWN | Down on D-pad | 2 |
#LEFT | Left on D-pad | 4 |
#RIGHT | Right on D-pad | 8 |
#ZL | ZL on Circle-Pad Pro or new 3DS | 4096 |
#ZR | ZR on Circle-Pad Pro or new 3DS | 2048 |
When setting a tiles in backgrounds, attributes can be applied to the tiles to have them appear differently. Is used by adding them to tile IDs.
' Place a background tile that is horizontally flipped and is rotated 90 degrees using constants.
BGPUT 0, 0, 0, 13 + #BGREVH + #BGROT90
Constant Name | Attribute Description | Value |
---|---|---|
#BGREVH | Horizontal flip | 16384 |
#BGREVV | Vertical flip | 32768 |
#BGROT0 | 0 degree rotation | 0 |
#BGROT90 | 90 degree rotation | 4096 |
#BGROT180 | 180 degree rotation | 8192 |
#BGROT270 | 270 degree rotation | 12288 |
When setting the character for sprites, attributes can be applied to sprites to have them appear differently. Typically used with SPCHR.
' Use constants to define a sprite that is displayed and is flipped horizontally
SPCHR 0, 0, 0, 16, 16, #SPSHOW + #SPREVH
Constant Name | Attribute Description | Value |
---|---|---|
#SPREVH | Horizontal flip | 8 |
#SPREVV | Vertical flip | 16 |
#SPROT0 | 0 degree rotation | 0 |
#SPROT90 | 90 degree rotation | 2 |
#SPROT180 | 180 degree rotation | 4 |
#SPROT270 | 270 degree rotation | 6 |
#SPSHOW | Display the sprite | 1 |
These can be used to identify what types of animations are happening for a certain sprite with SPCHK.
Constant Name | Animation Type | Value |
---|---|---|
#CHKXY | XY-coordinates | 1 |
#CHKZ | Z-coordinates | 2 |
#CHKUV | UV-coordinates | 4 |
#CHKI | Definition number | 8 |
#CHKR | Rotation | 16 |
#CHKS | Magnification XY | 32 |
#CHKC | Display color | 64 |
#CHKV | Variable | 128 |
Requires Sound Processing DLC
These are constants that state the type of operation to be done with ARYOP.
' Use #AOPMUL constant to define doing multiplication between the arrays.
ARYOP #AOPMUL, OW, P1, P2
Constant Name | Operation Type | Value |
---|---|---|
#AOPADD | Addition | 0 |
#AOPSUB | Subtraction | 1 |
#AOPMUL | Multiplication | 2 |
#AOPDIV | Division | 3 |
#AOPMAD | Product-Sum | 4 |
#AOPLIP | Linear interpolation | 5 |
#AOPCLP | Clamping | 6 |
Requires Sound Processing DLC
These are constants that state the type of operation to be done with FFTWFN.
Constant Name | Operation Type | Value |
---|---|---|
#WFRECT | Rectangular window | 0 |
#WFHAMM | Hamming window | 1 |
#WFHANN | Hanning window | 2 |
#WFBLKM | Blackman window | 3 |
Requires Sound Processing DLC
These are constants that state the type of filtering to be done with BQPARAM.
Constant Name | Filtering Type | Value |
---|---|---|
#BQAPF | All pass filter | 0 |
#BQLPF | Low pass filter | 1 |
#BQHPF | High pass filter | 2 |
#BQBPF | Bandpass filter | 3 |
#BQBSF | Band stop filter | 4 |
#BQLSF | Low shelf filter | 5 |
#BQHSF | High shelf filter | 6 |
#BQPEQ | Peaking equalizer | 7 |
Requires Sound Processing DLC
These are constants to select the channel to control with PCMVOL.
Constant Name | Channel | Value |
---|---|---|
#PVLEFT | Left | 0 |
#PVRIGHT | Right | 1 |