Scratch for Java

Window

The Window class represents a singleton window for the application. It provides various constructors to create a window with different configurations such as dimensions, full screen mode, and asset paths. The class ensures that only one instance of the window can be created at any time.

The class also provides methods to interact with the window and the application, such as retrieving the window dimensions, setting the debug mode, managing stages, and exiting the application.

Example usage:

Window window = new Window();
window.setDebug(true);

Static Fields

Name Type Description
DEBUG_COLOR int[] The default color used for debugging purposes. You can modify this array to change the debug color. For example, to set the debug color to green, you can do: ```java Window.DEBUG_COLOR = new int[] { 0, 255, 0 }; ```
TEXTURE_SAMPLING_MODE int 2: Point Sampling. 3: Linear. 4: Bilinear. 5: Trilinear. Point sampling: both magnification and minification filtering are set to nearest. Linear sampling: magnification filtering is nearest, minification set to linear Bilinear sampling: both magnification filtering is set to linear and minification either to linear-mipmap-nearest (linear interpolation is used within a mipmap, but not between different mipmaps). Trilinear sampling: magnification filtering set to linear, minification to linear-mipmap-linear, which offers the best mipmap quality since linear interpolation to compute the value in each of two maps and then interpolates linearly between these two values. You can change the texture sampling mode by setting this variable before creating the Window instance. For example, to use linear sampling, you can do: ```java Window.TEXTURE_SAMPLING_MODE = 3; ```
Window