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 | Перемещает объект в указанную точку. |
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 |
DeleteButton | Deletes a button object |
DeleteStatic | Deletes a static control object |
DeleteEditor | Deletes an editor object |
DeleteWindow | Deletes a window object |
Функции управления курсором | |
SetCursor | Устанавливает стандартный курсор. |
GetCursor | Возвращает имя файла спрайта курсора или null, если курсор не задан |
GetCursorObject | Возвращает ссылку на спрайт курсора (объект) или null, если курсор не задан |
RemoveCursor | Удаляет стандартный курсор. |
HasCursor | Выясняет, задан ли стандартный курсор для объекта. |
Функции для работы со сценариями | |
AttachScript | Выполняет файл сценария и прикрепляет его к объекту. |
DetachScript | Выгружает из памяти файл сценария и удаляет его связку с объектом. |
IsScriptRunning | Выясняет, прикреплён ли указанный файл сценария к объекту. |
CanHandleMethod | Выясняет, поддерживает ли объект метод с указанным именем. |
PlaySound | Воспроизводит звук. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть). |
PlaySoundEvent | Воспроизводит звук и генерирует событие, когда воспроизведение закончится. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть). |
StopSound | Останавливает воспроизведение звука (если есть). |
PauseSound | Ставит на паузу воспроизведение звука. |
ResumeSound | Продолжает воспроизведение после паузы. |
IsSoundPlaying | Выясняет, воспроизводится ли в настоящий момент звуковой файл. |
SetSoundPosition | Задаёт текущую позицию для воспроизведения в звуковом файле. |
GetSoundPosition | Возвращает текущую позицию для воспроизведения в звуковом файле |
SetSoundVolume | Устанавливает громкость звука. |
GetSoundVolume | Возвращает значение уровня громкости звука. |
LoadSound | Инициализирует звук из файла, подготавливая его к воспроизведению. |
Звуковые эффекты | |
SoundFXNone | Удаляет любой звуковой эффект, прикреплённый к объекту. |
SoundFXEcho | Задаёт эффект эха для любого звука, привязанного к объекту. |
SoundFXReverb | Задаёт эффект реверберации для любого звука, привязанного к объекту. |
Обработка событий | |
ApplyEvent | Вызывает указанное событие для объекта. |
CanHandleEvent | Выясняет, имеет ли объект обработчик для указанного события. |
Parent (только для чтения) | 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 (только для чтения) | Returns a reference to the next control in z-order |
PrevSibling (только для чтения) | Returns a reference to the previous control in z-order |
Type (только для чтения) | Returns always "window" |
NumControls (только для чтения) | 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 | Внутреннее имя объекта. |
Caption | Заголовок объекта. |
AccCaption | Специальный заголовок объекта, используемый специальными фукциями движка для людей с ослабленным зрением. |
X | Координата X объекта. |
Y | Координата Y объекта. |
Height (только для чтения) | Возвращает текущую высоту объекта (учитывает масштаб персонажей). |
Filename (только для чтения) | Возвращает имя файла объекта. |
Ready (только для чтения) | Возвращает true, если объект в настоящий момент не совершает никакого действия. |
Interactive | Указывает, должен ли объект реагировать на действия пользователя (быть интерактивным). |
SoundPanning | Указывает, должен ли звук, воспроизводимый данным объектом, панорамироваться в зависимости от его позиции на экране. |
NonIntMouseEvents | Указывает, должен ли объект реагировать на события MouseEntry и MouseLeave, даже в том случае, если игра работает в неинтерактивном режиме. |
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 | Была нажата левая кнопка мыши. |
RightClick | Была нажата правая кнопка мыши. |
MiddleClick | Была нажата средняя кнопка мыши. |
LeftDoubleClick | Был сделан двойной щелчок левой кнопкой мыши. |
RightDoubleClick | Был сделан двойной щелчок правой кнопкой мыши. |
LeftRelease | Была отпущена левая кнопка мыши. |
RightRelease | Была отпущена правая кнопка мыши. |
MiddleRelease | Была отпущена средняя кнопка мыши. |
MouseWheelUp | Колёсико мыши было прокручено вверх. |
MouseWheelDown | Колёсико мыши было прокручено вниз. |
Keypress | Была нажата клавиша. Для выяснения деталей (какая клавиша была нажата и др.), используйте переменную Keyboard. |
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.
Перемещает объект в указанную точку.
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.
Deletes a button object
Deletes a static control object
Deletes an editor object
Deletes a window object
Устанавливает стандартный курсор.
Возвращает true в случае успеха.
Возвращает имя файла спрайта курсора или null, если курсор не задан
Возвращает ссылку на спрайт курсора (объект) или null, если курсор не задан
Удаляет стандартный курсор.
Выясняет, задан ли стандартный курсор для объекта.
Возвращает true, если для объекта задан свой собственный стандартный курсор.
Выполняет файл сценария и прикрепляет его к объекту.
Возвращает true, если сценарий был успешно выполнен.
К каждому объекту WME можно прикреплять несколько сценариев.
Выгружает из памяти файл сценария и удаляет его связку с объектом.
В случае удачного выполнения, метод вернёт значение true.
Экземпляры сценария (threads) - это исполняемые в настоящий момент обработчики событий и методы, которые тем или иным образом включают в себя выполнение данного сценария.
Выясняет, прикреплён ли указанный файл сценария к объекту.
Возвращает true, если указанный сценарий прикреплён к объекту.
Выясняет, поддерживает ли объект метод с указанным именем.
Возвращает true, если объект поддерживает метод с указанным именем.
Воспроизводит звук. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть).
В случае удачного выполнения, метод вернёт значение true.
Воспроизводит звук и генерирует событие, когда воспроизведение закончится. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть).
В случае удачного выполнения, метод вернёт значение true.
Останавливает воспроизведение звука (если есть).
В случае удачного выполнения, метод вернёт значение true.
Ставит на паузу воспроизведение звука.
В случае удачного выполнения, метод вернёт значение true.
Продолжает воспроизведение после паузы.
В случае удачного выполнения, метод вернёт значение true.
Выясняет, воспроизводится ли в настоящий момент звуковой файл.
Если звук воспроизводится, метод вернёт true.
Задаёт текущую позицию для воспроизведения в звуковом файле.
В случае удачного выполнения, метод вернёт значение true.
Возвращает текущую позицию для воспроизведения в звуковом файле
Позиция в мс.
Устанавливает громкость звука.
В случае удачного выполнения, метод вернёт значение true.
Возвращает значение уровня громкости звука.
Текущий уровень громкости в процентах.
Инициализирует звук из файла, подготавливая его к воспроизведению.
В случае удачного выполнения, метод вернёт значение true.
Этот метод используется для кэширования звуковых файлов. Инициализация звука занимает некоторое время, поэтому желательно разместить её в стартовом сценарии сцены, чтобы метод PlaySound не замедлял игру. Для этой цели и служит метод LoadSound. Чтобы воспроизвести кэшированный звук, нужно просто вызвать метод PlaySound без указания имени файла, например, SomeObject.PlaySound(false);
Удаляет любой звуковой эффект, прикреплённый к объекту.
Задаёт эффект эха для любого звука, привязанного к объекту.
Пример: actor.SoundFXEcho(50, 50);
Задаёт эффект реверберации для любого звука, привязанного к объекту.
Пример: actor.SoundFXReverb(0, 0, 2000);
Вызывает указанное событие для объекта.
Возвращает true, если событие было вызвано успешно.
Выясняет, имеет ли объект обработчик для указанного события.
Возвращает true, если объект может обрабатывать запрашиваемое событие.