Before reading these tutorials, it is assumed that you have at least a Beginner's grasp of Cobra and programming, that you understand how to create variables and open a simple screen. This is all covered in the Beginners tutorials.
The Pure2D library is a module that you can use in Cobra. It allows you to draw 2D graphics to the screen with exceptional speed and blending capabilities. Pure2D requires no external DLLs like DirectX or special hardware to work, so it can be used on any computer running Windows 95 or above!
To use the commands in the Pure2D library, you have to specify it in the
Uses command of your program, like so.
Program Uses Pure2D, Keyset
Begin OpenScreen
Repeat // Update program, display graphics etc, here Text(10, 10, "Helloooooooo Pure2d!") Flip Until KeyDown(VK_ESCAPE)
CloseScreen End
|
Note, we have also used the
Keyset library as it allows understandable constants such as
VK_ESCAPE to be used, instead of figuring out what the numeric value of the Escape key is.
By specifying that we will be using
Pure2D, Cobra sets up the program's commands to use that library. All drawing, window opening, and even input commands, relate to that library now.
It is important to note that if you did not specify Pure2D or Cobra3D in the
Uses command, the
OpenScreen command would not work and your program would generate an error. Without including a module, the only way to output information is with the
MessageBox procedure.