Where does print() print to?
-
print() like all draw commands by default prints to the framebuffer which is a buffer used to hold the screen contents.
This is written to the screen when update() is called. This is used to reduce the amount of screen updates and to ensure that programs run at the same speed.
Update() will only refresh the screen every 1/60th of a second so that your program will run at 60fps (the frame rate will drop if you do too much work between update calls)
-
There is a good debug function here: https://fuzearena.com/forum/topic/123/debugger-support/4
-
I think "Unrecognised type" is when Fuze cannot convert your data into the string type needed by the print() function. I've encountered this when trying to print out a file handle (see "File Handling" commands in Fuze Help). It crashes the program.
-
I have just had a look and type 4 seems to be a void (or nil pointer) which basically means an undefined or unassigned value
-
Using print() has never printed anything to my screen!
-
I’ve just been making all my variables global and drawtext() ing them right at the end before my update(), otherwise it seems they just got covered up. In 2d, you could do the same with print(), probably, but it might be smarter to write a debug() function with a list that you just add whatever you want to that all gets printed out right at the end..
-
@Jack_Blue On it's own it doesn't:
try the following:
loop clear() print("Hello World") update() repeat
clear() - clears the frame buffer
print() - prints a message to the framebuffer
update() - outputs the framebuffer to the screen every 1/60 th of a second
-
Thanks!
What if I want to do this:
loop clear() for i = 0 to 100 loop print(i) repeat update() repeat
Not all of this will be able to fit on the screen at once!
-
-
So you can use printat(x,y, value) to print at a particular screen location:
loop clear() for i = 0 to 100 loop printat( i % 10 * 5, int ( i / 10), i) repeat update() repeat
-
@Jack_Blue pycharm is good so print does the same like in Python but its more like the print from python 3 and you have to use update()
To update your screen.