Changing screen color

Changing screen color

Now that you're accustomed to every type of block, it's time to learn how to use them!

There will be a series of small examples where you'll be able to get an understanding of how the Nibble library works.

Each example will show different functionalities. In the end, we'll just bring all of that together to create a cool app!

Let's begin!

Example #1

Let's kick things off as simply as possible.

The main component on Nibble is definitely the screen since working without one would be pretty much impossible.

What we want to do as a test is to change the screen color of our program.
The default screen color is black, or as it is known in our library, TFT_BLACK.

All colors from this library are labeled with TFT_ prefix because they are made to be used on TFT screens.

random image

Now let's move to the code generated by the blocks.

Since we want to turn our screen cyan, we are calling sprite->clear() function from the Display section, just with a different parameter.

Now that we've made sure everything is set, we can run the program. It will first be compiled and then uploaded to the console.

Nibble's screen should now be cyan. It's really as simple as that.

This is just a beginning but you can imagine that the possibilities of this screen are countless.  

random image


The full list of available colors can be found in the Display section

Restoring  defaults

Now, what if we want to stop making cool things and just use our gaming console? Well, it takes only a couple of clicks to get everything back to normal.

Anytime you want to restore the original Nibble firmware to your phone, you can do it by pressing the 'Restore firmware' button on the main menu and choose 'Nibble'.

Just don't forget to save the project before exiting!

random image

random image
random image

Now that we've covered the basics, let's head out to something a little bit more advanced.