GG BASIC REFERENCE
The Screen
The Graphic screen size is 1024x700.
Variables
In the GG Basic we use to declare a variable in this way (we don't mind if is a number or a string):
$variable = 100;
$name = "Hello World"
So if we're going to use a command like Print($variable, 10, $name, 16) we will see the result at X = 100 with a text Hello World.
Command List
BgColor(R, G, B, A)
Change the background color into RGBA specified.
You can change the Alpha too in this command to get some transparent effects.
R = Red, G = Green, B = Blue, A = Alpha
Box(x1, y1, x2, y2, filled, R, G, B, A)
Paint a filled or empty box
x1 : integer x coord for the left top corner
y1 : integer y coord for the left top corner
x2 : integer x coord for the right bottom corner
y2 : integer y coord for the right bottom corner
filled : 0/1 switch between filled or empty box
R,G,B,A : integers from 0 to 255 as RGB color + alpha
Cls
Clear Screen but take the current background color.
Circle(cx, cy, radius, filled, R, G, B, A)
Paint an empty or filled circle.
cx : integer center x coord
cy : integer center y coord
radius : cirlce radius starting from center in pixel
filled : 0/1 to choose an empty or filled circle
R,G,B,A : red, green, blue, alpha
Date(format string)
Example : date("hh:mm:ss")
End
End the program immediately.
For(var = n, max, step)
var : for example $a
n : the starting integer
max : the max value $a can reach
step : the increment value
Iterate MAX times the code contained between FOR and NEXT.
Example : for($i = 1, 10, 1) .... next($i)
This example show how to iterate the code inside using $i as the counter, 10 the max value it can reach, and 1 the step to increase.
Goto(line)
Jump from the current line to the specified.
Example : Goto(25)
GoSub(line)
Jump from the current line to the specified and return to the next when "Return" is found.
Example : GoSub(25)
If(expression evaluation) Then line
Example : If($var == 100) Then 40
If the condition is TRUE the next line to be executed will be the 40
At the moment you can only combine multiple expression on the same line...
Example : if($var1 == "ok" AND $var2 == "no") Then 60
Multiline with the IF - END IF will be added in the future.
Input(x, y, width, font_size, input_var)
Create an input editbox to (x, y) and store it into the $input_var.
x : integer coord
y : integer y coord
width : max width size in px of the editbox
font_size : integer value.
Line(x1, y1, x2, y2, R, G, B, A)
Paint a line from (x1, y1) to (x2, y2).
All values are integer.
Next(var)
Start the for with the specified var
Example : next($a)
Point(x, y, px_size, R, G, B, A)
Paint a pixel with a
px_size at (x, y) in RGBA.
x : integer x coord
y : integer y coord
px_size : integer value
Print(x, y, "YourText", font_size, align)
Print a text contained between " " to the screen.
x : integer coord
y : integer y coord
font_size : integer value.
align : 0 = left, 1 = center, 2 = right
Render
Render the graphics commands processed until this moment.
Return
Return to the last GoSub processed.
Speech("Text to speech...")
Connect to our server to get text to speech MP3.
You need an internet connection for this feature.
Sprite("name_id", "url", x, y, visible)
Create new sprite at coordinates (x, y) with an url image (we suggest PNG or JPG)
- name_id : a string that you can use later to recall the sprite for commands
- url : http url of the image to load
- x, y : coordinates
- visible : 0/1 to show or hide the sprite
Example : Sprite("mySprite1", "
www.image.com/image.png", 100, 100, 1)
SpriteCom("name_id", x, y, visible, delete)
Process some commands on the specific sprite. (new commands will be added in new versions)
- name_id : a string to point to a specific sprite you created before
- x, y : change the current coordinates of the sprite
- visible : 0/1 to show or hide the sprite
- delete : 0/1 if you chose 1 the sprite will be deleted from the memory (this is the current way to delete a sprite)
TextFont("Default")
Font available : Default, Commodore, Menlo
TextColor(R, G, B, A)
Change the next text color into RGBA specified.
You can change the Alpha too in this command to get some transparent effects.
R = Red, G = Green, B = Blue, A = Alpha
Timer
Return the timestamp in Linux.
Example : $time = Timer
This manual is updated constantly updated...anyway you will find a list of functions inside the app.