Custom Windows

This type of object represents a window that you create via mainWindow.createMediaWindow. It's a specialization of the basic Window Objects that the system provides for the main playfield window, the backglass window, and so forth. You can use custom windows to supplement the standard set of windows if you have additional media types that you want to display, or to display entirely custom graphics using Drawing Layers.

For some examples of how to create your own custom windows, see Custom Media Window in the Worked Examples section.

Class inheritance structure

Basic Window Object
Secondary Window
Custom Window

Event target

A custom window object is an event target, so you can use the standard event methods (on(), off(), addEventListener(), etc) to add and remove event listeners. See EventTarget. This window receives the following event types:

Properties and methods

Since Custom Windows inherit from the Secondary Window base class, they have all of the methods and properties that a Secondary Window has, as described in Secondary Windows. That class is itself a subclass of the basic common window class, so a Custom Window also has the standard window functions, described in Window Objects.

In addition to the inherited functionality, Custom windows also have some extended functions of their own, as listed below.

showMediaWhenRunningFlag: This property lets you control whether or not the window continues to show media while a game is running. This is the custom window equivalent of the options dialog checkboxes that let you control the same behavior for the built-in windows. This can take on three possible values:

Note that values of true and false override any "key" lookup, so you can use these to control the behavior unconditionally in Javascript code. For example, you could use a gameselect event to decide on how to handle the window for the current game each time a new game is selected, setting showMediaWhenRunningFlag to the desired value.