Knowledge Base‎ > ‎Programming‎ > ‎Python‎ > ‎Python Reference‎ > ‎Python Reference‎ > ‎

size()

 Name

 

 Examples

 
 

 Description        

 

As with Processing, the window size may be changed with the size() function. It has two required arguments: the width and height of the desired window in pixels. Thus,

size(200,200)

will open a 200x200 pixels window.

By default, pyprocessing windows are not resizable, since this is the expected Processing behavior. You can, however, request a resizable window by adding the keyword argument resizable=True:

size(200,200,resizable=True)

It is even possible to request a full screen window by using the keyword argument fullscreen=True.

Pyprocessing will adjust the coordinate system to reflect the changed window dimensions. Thus, if the window is resized so that it is now 250 pixels wide and 150 pixels high, the pixels will be addressed by x in interval [0, 250) and y in interval [0, 150), where pixel (0,0) is the top left corner of the window, i.e., the y axis points down.

Of course, if the window is resized, the original contents drawn so far will be lost, and pyprocessing will automatically call the draw() function you defined in your program, if any (see the next section).

See: http://code.google.com/p/pyprocessing/wiki/UsageInstructions

 Syntax

 
 

 Parameters

 
 

 Related

 
 

Comments