Can't drawtext to screen..
BlitzMax Forums/BlitzMax Beginners Area/Can't drawtext to screen..
| ||
Starting to orient myself with Blitzmax for the first time. The following code won't display the text. Also, how do you put your code in a box like you all do. Forgot how to do it. Thanks. Graphics 1920,1080,32 Global Image:Int[2] Image[1]=2 Cls DrawText ("Text here"+ Image[1],500,500) Flip Repeat Until KeyHit(Key_escape) |
| ||
Cls/drawtext/flip need to be inside the repeat/until loop, not before it. |
| ||
Graphics - Creates 2 buffers, one a front buffer (What you see on the monitor) and one a back buffer (Which you dont see, but, this is the one you actually draw too) Cls - Clear the backbuffer DrawText - Draw text to the back buffer Flip - Shift the back buffer to the front buffer, and thus, you see what you've drawn Thats how it works Couple that inside a loop, and what you have is basically a constant swapping of buffers, which is why you'll end up with a consistant drawing of images/text on the screen, as in, no flicking! Dabz Last edited 2012 |