The Window object allows you to access the properties of your game's windows. Window objects are created by loading a window definition file using the Game.LoadWindow metod. A special case is the window used for the inventory. It can be queried using the Game.GetInventoryWindow method.
SetFont | Sets a normal font. |
SetImage | Sets a background image (sprite). |
GetImage | Returns the filename of the background sprite (or null if no sprite is set) |
GetImageObject | Returns a reference to the background sprite (or null if no sprite is set) |
Focus | Focuses the control. |
MoveAfter | Moves the control in z-order after a given control. |
MoveBefore | Moves the control in z-order before a given control. |
MoveToTop | Moves the control to the top of the z-order. |
MoveToBottom | Moves the control to the bottom of the z-order. |
SkipTo | Moves an object to a specified location. |
Actions | |
GetControl | Get a reference to a given object contained in this window |
SetInactiveFont | Sets a font to be used when the window is inactive. |
SetInactiveImage | Sets a background image (sprite) to be used when this window is inactive. |
GetInactiveImage | Returns the filename of the inactive background sprite (or null if no sprite is set) |
GetInactiveImageObject | Returns a reference to the inactive background sprite (or null if no sprite is set) |
Close | Closes the window. |
GoExclusive | Makes the window an exclusive object on screen. |
GoSystemExclusive | Pauses the game and makes the window an exclusive object on screen. |
Center | Centers the window on screen. |
LoadFromFile | Loads the window definition from a specified file. |
CreateButton | Dynamically creates a new button control |
CreateStatic | Dynamically creates a new static control |
CreateEditor | Dynamically creates a new editor control |
CreateWindow | Dynamically creates a new sub-window control |
CreateEntityContainer | Dynamically creates a new entity container control |
DeleteButton | Deletes a button object |
DeleteStatic | Deletes a static control object |
DeleteEditor | Deletes an editor object |
DeleteWindow | Deletes a window object |
DeleteControl | Deletes a child control object (button, static, etc.) |
Cursor functions | |
SetCursor | Sets the standard cursor. |
GetCursor | Returns the filename of the cursor sprite (or null if no cursor is set) |
GetCursorObject | Returns a reference to the cursor sprite (or null if no cursor is set) |
RemoveCursor | Removes the standard cursor. |
HasCursor | Queries whether the standard cursor is set. |
Script functions | |
AttachScript | Executes a script file and attaches it to the object. |
DetachScript | Terminates a specified script file and detaches it from an object. |
IsScriptRunning | Queries whether a specified script file is running and attached to an object. |
CanHandleMethod | Queries whether the object supports a method of a specified name. |
Sound functions | |
PlaySound | Plays a sound. If the filename is omitted, the currently assigned sound is played (if any). |
PlaySoundEvent | Plays a sound and triggers an event when the sound is over. If the filename is omitted, the currently assigned sound is played (if any). |
StopSound | Stops the currently playing sound (if any). |
PauseSound | Pauses the currently playing sound. |
ResumeSound | Resumes a paused sound playback. |
IsSoundPlaying | Queries whether a sound playback is in progress. |
SetSoundPosition | Sets the sound's current playing position. |
GetSoundPosition | Queries the sound's current playing position |
SetSoundVolume | Sets a volume of the currently playing sound. |
GetSoundVolume | Gets a volume of the currently playing sound. |
LoadSound | Initializes a sound from file and makes it ready to be played. |
Sound effects functions | |
SoundFXNone | Removes any sound effect currently assigned to this object. |
SoundFXEcho | Assigns an echo effect to the sounds played by this object. |
SoundFXReverb | Assigns a reverb effect to the sounds played by this object. |
Event functions | |
ApplyEvent | Applies a named event to the object. |
CanHandleEvent | Queries whether the object has an event handler for a specified event. |
Parent (read only) | Returns a reference to a parent window of this control (or null) |
ParentNotify | Specifies whether this control should notify its parent about events |
Width | A width of the control |
Height | A height of the control |
Visible | Specifies whether the control is visible |
Disabled | Specifies whether the control is disabled |
Text | A text the control displays |
NextSibling (read only) | Returns a reference to the next control in z-order |
PrevSibling (read only) | Returns a reference to the previous control in z-order |
Type (read only) | Returns always "window" |
NumControls (read only) | Returns a number of controls contained in this window. |
Exclusive | Specifies if the window is in exclusive mode. |
SystemExclusive | Specifies if the window is in system exclusive mode. |
Menu | Specifies whether this is a "menu" type window (it's closed when the user clicks anywhere outside the window). |
InGame | Specifies whether this is an "in-game" type window (it's always displayed before the inventory window). |
ClipContents | Specifies whether the contained controls are clipped when they lie partially outside the window. |
Transparent | Specifies whether the window receives click events. All the mouse clicks go through for transparent windows. |
Name | The internal name of the object. |
Caption | The caption of the object. |
AccCaption | A special caption of the object used for accessibility purposes. |
X | The X position of the object. |
Y | The Y position of the object. |
Height (read only) | Returns the current height of the object. In case of actors and entities the scaling is taken into account. |
Filename (read only) | Returns the filename. |
Ready (read only) | Returns whether the object isn't currently performing any action. |
Interactive | Specifies whether the object recieves user input. |
SoundPanning | Specifies whether the sounds played by this object are automatically panned depending on object's position on screen. |
NonIntMouseEvents | Specifies if the object can receive the MouseEntry and MouseLeave events even if the game is in non-interactive mode. |
Movable | Specifies whether the object can be moved by its sprites (in case the sprite frames have a "move" property set). |
Scalable | Specifies whether the object is affected by scene's scaling levels. |
Rotatable | Specifies whether the object is affected by scene's rotation levels. |
Colorable | Specifies whether the object is affected by scene's color regions. |
AlphaColor | Specifies an RGBA color of this object (overrides scene coloring); set to 0 to reset default behavior. |
BlendMode | Specifies how the object's image is blended with the background colors; 0...normal mode, 1...additive blending, 2...subtractive blending |
Scale | Specifies a scale of this object (overrides scene scaling); set to null to reset default behavior. |
ScaleX | Specifies horizontal scale of this object; set to null to reset default behavior. |
ScaleY | Specifies vertical scale of this object; set to null to reset default behavior. |
RelativeScale | Specifies a scale amount to be added to the default scene scale. |
Rotate | Specifies rotation of this object (in degrees); overrides scene rotation; set to null to reset default behavior; not available in compatibility mode |
RelativeRotate | Specifies a rotation amount to be added to the default scene rotation. |
FadeColor | Specifies an alpha color which the background is faded to when this window is being displayed. |
AlphaColor | Specifies an alpha color which is applied to the entire window. |
PauseMusic | Specifies whether the music is paused when this window is running in system-exclusive mode. |
LeftClick | The left mouse button has been pressed. |
RightClick | The right mouse button has been pressed. |
MiddleClick | The middle mouse button has been pressed. |
LeftDoubleClick | The left mouse button has been double-clicked. |
RightDoubleClick | The right mouse button has been double-clicked. |
LeftRelease | The left mouse button has been released. |
RightRelease | The right mouse button has been released. |
MiddleRelease | The middle mouse button has been released. |
MouseWheelUp | The mouse wheel has been rolled up. |
MouseWheelDown | The mouse wheel has been rolled down. |
Keypress | Some key has been pressed. Use the Keyboard variable to find out the details. |
Sets a normal font.
If the method succeeds, the return value is true.
Sets a background image (sprite).
If the method succeeds, the return value is true.
Returns the filename of the background sprite (or null if no sprite is set)
Returns a reference to the background sprite (or null if no sprite is set)
Focuses the control.
Moves the control in z-order after a given control.
If the method succeeds, the return value is true.
Moves the control in z-order before a given control.
If the method succeeds, the return value is true.
Moves the control to the top of the z-order.
If the method succeeds, the return value is true.
Moves the control to the bottom of the z-order.
If the method succeeds, the return value is true.
Moves an object to a specified location.
Get a reference to a given object contained in this window
Returns a reference to a requested control or null if such a control doesn't exist
This method has been previously called "GetWidget" and this name is still valid for backwards compatibility.
Sets a font to be used when the window is inactive.
If the method succeeds, the return value is true.
Sets a background image (sprite) to be used when this window is inactive.
If the method succeeds, the return value is true.
Returns the filename of the inactive background sprite (or null if no sprite is set)
Returns a reference to the inactive background sprite (or null if no sprite is set)
Closes the window.
If the method succeeds, the return value is true.
Note that this method only removes window from screen but it stays loaded in memory. If you no longer need the window, you should unload it using the Game.UnloadObject method.
Makes the window an exclusive object on screen.
The user cannot interact with any other object while the window is in exclusive state. Use the Window.Close() method to cancel the exclusive state.
Pauses the game and makes the window an exclusive object on screen.
This method is intended for system windows, such as save/load dialogs, because the entire game is frozen while the window is in system exclusive state. Use the Window.Close() method to cancel the exclusive state.
Centers the window on screen.
Loads the window definition from a specified file.
If the method succeeds, the return value is true.
Dynamically creates a new button control
Returns the newly created button object
Use the DeleteButton method to remove the button.
Dynamically creates a new static control
Returns the newly created static control object
Use the DeleteStatic method to remove the control.
Dynamically creates a new editor control
Returns the newly created editor object
Use the DeleteEditor method to remove the editor.
Dynamically creates a new sub-window control
Returns the newly created window object
Use the DeleteWindow method to remove the window.
Dynamically creates a new entity container control
Returns the newly created entity container object
Use the DeleteControl method to remove the entity container.
Deletes a button object
Deletes a static control object
Deletes an editor object
Deletes a window object
Deletes a child control object (button, static, etc.)
Sets the standard cursor.
Returns true if the cursor has been set succesfuly.
Returns the filename of the cursor sprite (or null if no cursor is set)
Returns a reference to the cursor sprite (or null if no cursor is set)
Removes the standard cursor.
Queries whether the standard cursor is set.
Returns true if the object has a custom mouse pointer assigned.
Executes a script file and attaches it to the object.
Returns true if the script has been executed succesfuly.
Each WME object can have multiple scripts attached.
Terminates a specified script file and detaches it from an object.
Returns true if the script has been detached succesfully.
Script threads are currently executed event handlers and methods.
Queries whether a specified script file is running and attached to an object.
Returns true if a specified script file is attached to an object.
Queries whether the object supports a method of a specified name.
Returns true if the object is able to handle the specified method.
Plays a sound. If the filename is omitted, the currently assigned sound is played (if any).
If the method succeeds, the return value is true.
Plays a sound and triggers an event when the sound is over. If the filename is omitted, the currently assigned sound is played (if any).
If the method succeeds, the return value is true.
Stops the currently playing sound (if any).
If the method succeeds, the return value is true.
Pauses the currently playing sound.
If the method succeeds, the return value is true.
Resumes a paused sound playback.
If the method succeeds, the return value is true.
Queries whether a sound playback is in progress.
If the sound is playing, the return value is true.
Sets the sound's current playing position.
If the method succeeds, the return value is true.
Queries the sound's current playing position
Returns the current playing position (in milliseconds).
Sets a volume of the currently playing sound.
If the method succeeds, the return value is true.
Gets a volume of the currently playing sound.
Returns the volume of the currently playing sound (in percent).
Initializes a sound from file and makes it ready to be played.
If the method succeeds, the return value is true.
Use this method to pre-cache a sound file. Initializing the sound takes some time and sometimes it's desirable to move all sound initialization to e.g. scene start so that the subsequent PlaySound calls don't slow the game down. That's what LoadSound is for. To play the pre-cached sound simply call PlaySound without specifying a filename, for example SomeObject.PlaySound(false);
Removes any sound effect currently assigned to this object.
Assigns an echo effect to the sounds played by this object.
Example: actor.SoundFXEcho(50, 50);
Assigns a reverb effect to the sounds played by this object.
Example: actor.SoundFXReverb(0, 0, 2000);
Applies a named event to the object.
Returns true it the event has been applied succesfuly.
Queries whether the object has an event handler for a specified event.
Returns true if the object is able to handle the specified event.