Shapes are pretty easy so let's start with those. This makes it easier to tinker with colours later on (which is very common when you're polishing your game and trying to get things just right). In the sample code above we have saved the colour into a variable but it is possible to use the colour directly within a function call for a shape or text if you want.Įven though we can use the colour directly it is best practice to save all your colours into variables at the top of the script and then just to use the variables. It is possible to create about 16.5 million colours which should be plenty for anyone. # What do you think this colour might be?.We set three values (each between 0 and 255) which represent the amount of RED, GREEN and BLUE in the colour. It's how we set the background colour for the window. You've already seen this format in the basic template. We will stick to the easiest method for this tutorial but be aware that there are others. There are a few ways in which we can do this. When creating text and shapes (and a few other things) we need to define their colour.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |