Blog Post

Small Basic Blog
2 MIN READ

Hello Moon Tutorial - Small Basic Featured Program

Ed Price's avatar
Ed Price
Former Employee
Feb 07, 2020

Today we're going to do a very simple Small Basic tutorial. We're going to say hello to the moon!

 

Boot up Small Basic, and let's get started!

 

 

Type this in:

 

===============

 

GraphicsWindow.TItle = "Hello Moon: The Program"

GraphicsWindow.Width = 320

GraphicsWindow.Height = 240

GraphicsWIndow.DrawImage("C:\Small Basic\backgroundbmp", 0, 0)

 

GraphicsWindow.BrushColor = "White"

GraphicsWindow.FontSize = 50

GraphicsWindow.DrawText(10, 120, "Hello Moon!")

 

===============

 

Great. Except it will throw an error, because you don't have the image! Here's what you do...

 

1. Download this image (right-click and Save it):

2. Be sure to save it where you want it!

3. Then update the code to set the path in line 5 to the correct location of the background.bmp file on your computer!

4. Run it again!

 

But what if we want to make it even easier? What if the image is online, and we just want to point to where the image already is? Try this code (replace the location of your image with "http://aka.ms/HelloMoon")...

 

===============

 

GraphicsWindow.TItle = "Hello Moon: The Program"

GraphicsWindow.Width = 320

GraphicsWindow.Height = 240

GraphicsWIndow.DrawImage("http://aka.ms/HelloMoon", 0, 0)

 

GraphicsWindow.BrushColor = "White"

GraphicsWindow.FontSize = 50

GraphicsWindow.DrawText(10, 120, "Hello Moon!")

 

===============

 

 

That's it! Hello Moon! Wasn't that easy? Now, everyone can code!

 

You can find this tutorial and hundreds more in our exhaustive Small Basic book: 

 

 

Have a Small and Basic day!

 

Ninja Ed

 

PS: Here are some additional images to use to make games:

 

 

 

 

 

 

 

Updated Jul 23, 2020
Version 10.0

5 Comments