hBasic > hManual > Samples

hBasic Manual
Examples and Demos

Code Samples

How to use a font family

How to load a console font
Demos
console-demo Console demo.
demo package as zip file
( click link to download )
gdemo1 Game demo using sprites.

demo package as zip file
hManual download Utility
download as a .bas file
How to use a font family

CONSOLE.SET "FONT sans-serif.BOLD"
or
.CS "FONT sans-serif.BOLD"      % .cs is a shortcut command

How to load a console font

FONT.LOAD fptr, "../source/LCDMN___.ttf"

IF fptr = -1 THEN PRINT "Error loading font" : END

CONSOLE.SET "FONT "+ int$(fptr)

.CS "TEXTSIZE 30"
? "Loaded Font"

Console-demo
This was the demo with release v3.28. It now only works for v5.68+ because of newly added commands.

The demo shows the capabilities of hBasic's re-engineered console. Particularly with CONSOLE.SET and PRINT.AT.
Note that all of these effects were done solely on the console.

Click to download the demo package as zip file
Unzip and copy all the files into the source/ directory.
Then run console-demo.bas.

The demo is really 3 demo files run in sequence (with the RUN command).
console-demo.bas  -->  font-fam.bas  -->  font-load.bas

gDemo1
Originally the demo with experimental release of hBasix (with libGdx).
This has now been ported over to hBasic v5.00+ (without libGdx) and uses the new mkII graphics engine.
It demonstrates a simple game where you need to catch droplets of water into a bucket.

Click to download the demo package as zip file
Unzip and copy all the files into the source/ directory.
Then run gdemo1.bas.
The demo demonstrates sprite movement and animation.

hManual Utitlity
Click here for instructions on how to download the hManual onto your device and view it.