Editor object

The Editor object allows you to access the properties of the single line editor controls contained in the game windows. Editor objects can be queried using the Window.GetControl method.


Methods

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
SetSelectedFont Sets a font for displaying the selected text within the editor control.
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.

Attributes

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 "editor"
SelStart Specifies an index of a first selected character in the editor.
SelEnd Specifies an index of a last selected character in the editor.
CursorBlinkRate Specifies a blinking rate of the editor's cursor (in milliseconds)
CursorChar Specifies a character to be used as a blinking cursor.
FrameWidth Specifies an offset of the text from the editor's position (in pixels)
MaxLength Specifies a maximum allowed lenght of the text contained in the editor (in characters)
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.

SetFont(Filename)

Sets a normal font.

Parameters

Filename
A filename of a font file to be used.

Return value

If the method succeeds, the return value is true.


SetImage(Filename)

Sets a background image (sprite).

Parameters

Filename
A filename of a sprite file to be used.

Return value

If the method succeeds, the return value is true.


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(Control)
MoveAfter(ControlName)

Moves the control in z-order after a given control.

Parameters

Control
A control object we will move our control after
ControlName
A name of a control object we will move our control after

Return value

If the method succeeds, the return value is true.


MoveBefore(Control)
MoveBefore(ControlName)

Moves the control in z-order before a given control.

Parameters

Control
A control object we will move our control before
ControlName
A name of a control object we will move our control before

Return value

If the method succeeds, the return value is true.


MoveToTop()

Moves the control to the top of the z-order.

Return value

If the method succeeds, the return value is true.


MoveToBottom()

Moves the control to the bottom of the z-order.

Return value

If the method succeeds, the return value is true.


SkipTo(X, Y)

Moves an object to a specified location.

Parameters

X
Destination X coordinate.
Y
Destination Y coordinate.

SetSelectedFont(Filename)

Sets a font for displaying the selected text within the editor control.

Parameters

Filename
A filename of a font file to be used.

Return value

If the method succeeds, the return value is true.


SetCursor(Filename)

Sets the standard cursor.

Parameters

Filename
Filename of a sprite file to be used as a cursor pointer.

Return value

Returns true if the cursor has been set succesfuly.


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.

Return value

Returns true if the object has a custom mouse pointer assigned.


AttachScript(Filename)

Executes a script file and attaches it to the object.

Parameters

Filename
The filename of the script file to be executed.

Return value

Returns true if the script has been executed succesfuly.

Remarks

Each WME object can have multiple scripts attached.


DetachScript(Filename, KillThreads)

Terminates a specified script file and detaches it from an object.

Parameters

Filename
The filename of the (running) script to be terminated and detached.
KillThreads
Specifies whether to terminate all running threads of this script (optional, default=false)

Return value

Returns true if the script has been detached succesfully.

Remarks

Script threads are currently executed event handlers and methods.


IsScriptRunning(Filename)

Queries whether a specified script file is running and attached to an object.

Parameters

Filename
The filename of the script to be queried.

Return value

Returns true if a specified script file is attached to an object.


CanHandleMethod(MethodName)

Queries whether the object supports a method of a specified name.

Parameters

MethodName
The name of the method to be checked.

Return value

Returns true if the object is able to handle the specified method.


PlaySound(Filename, Looping, LoopStart)
PlaySound(Looping, LoopStart)

Plays a sound. If the filename is omitted, the currently assigned sound is played (if any).

Parameters

Filename
The filename of the sound file to be played
Looping
Whether the sound should be looped (optional, default = false).
LoopStart
The point from which the sound restarts when looping, in milliseconds (optional, default=0).

Return value

If the method succeeds, the return value is true.


PlaySoundEvent(Filename, EventName)
PlaySoundEvent(EventName)

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).

Parameters

Filename
The filename of the sound file to be played
EventName
The name of the event to be triggered after the sound finishes.

Return value

If the method succeeds, the return value is true.


StopSound()

Stops the currently playing sound (if any).

Return value

If the method succeeds, the return value is true.


PauseSound()

Pauses the currently playing sound.

Return value

If the method succeeds, the return value is true.


ResumeSound()

Resumes a paused sound playback.

Return value

If the method succeeds, the return value is true.


IsSoundPlaying()

Queries whether a sound playback is in progress.

Return value

If the sound is playing, the return value is true.


SetSoundPosition(Time)

Sets the sound's current playing position.

Parameters

Time
A new playing position (in milliseconds)

Return value

If the method succeeds, the return value is true.


GetSoundPosition()

Queries the sound's current playing position

Return value

Returns the current playing position (in milliseconds).


SetSoundVolume(Volume)

Sets a volume of the currently playing sound.

Parameters

Volume
A new sound volume (in percent).

Return value

If the method succeeds, the return value is true.


GetSoundVolume()

Gets a volume of the currently playing sound.

Return value

Returns the volume of the currently playing sound (in percent).


LoadSound(Filename)

Initializes a sound from file and makes it ready to be played.

Parameters

Filename
The sound file to be loaded

Return value

If the method succeeds, the return value is true.

Remarks

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);


SoundFXNone()

Removes any sound effect currently assigned to this object.


SoundFXEcho(WetDryMix, Feedback, LeftDelay, RightDelay)

Assigns an echo effect to the sounds played by this object.

Parameters

WetDryMix
Wet/Dry Mix, in percent (0 to 100)
Feedback
Feedback, in percent (0 to 100)
LeftDelay
Left delay, in milliseconds (1 to 2000)
RightDelay
Right delay, in milliseconds (1 to 2000)

Remarks

Example: actor.SoundFXEcho(50, 50);


SoundFXReverb(InGain, ReverbMix, ReverbTime, HighFreqRTRatio)

Assigns a reverb effect to the sounds played by this object.

Parameters

InGain
In gain, in dB (-96 to 0)
ReverbMix
Reverb mix, in dB (-96 to 0)
ReverbTime
Reverb time, in milliseconds (0.001 to 3000)
HighFreqRTRatio
HighFreq RT Ratio (0.001 to 0.999)

Remarks

Example: actor.SoundFXReverb(0, 0, 2000);


ApplyEvent(EventName)

Applies a named event to the object.

Parameters

EventName
A name of the event to be applied to the object.

Return value

Returns true it the event has been applied succesfuly.


CanHandleEvent(EventName)

Queries whether the object has an event handler for a specified event.

Parameters

EventName
The name of the event to be checked.

Return value

Returns true if the object is able to handle the specified event.