Drag[en]gine Script Module DragonScript
1.23
|
Behavior instance. More...
Public Member Functions | |
Point | desktopPoint (DVector worldPosition) |
Calculate desktop position for world position or null if outside. More... | |
Point | desktopPointEverywhere (DVector worldPosition) |
Calculate desktop position for world position. More... | |
Point | desktopPointRay (DVector origin, DVector direction) |
Calculate desktop position for world ray intersection. More... | |
void | dispose () |
Dispose of behavior instance. More... | |
String | getBone () |
Bone name or empty string if not set. More... | |
ECBehaviorControlDesktop | getECBehavior () |
Behavior. More... | |
Vector | getLowerLeft () |
Virtual plane lower left position. More... | |
Vector | getLowerRight () |
Virtual plane lower right position. More... | |
ECBehaviorRenderableDesktop.Instance | getRenderableDesktop () |
Renderable desktop behavior instance. More... | |
Vector | getUpperLeft () |
Virtual plane upper left position. More... | |
DVector | getWorldLowerLeft () |
Virtual plane lower left position in world space. More... | |
DVector | getWorldLowerRight () |
Virtual plane lower right position in world space. More... | |
DMatrix | getWorldMatrix () |
Virtual plane matrix in world space. More... | |
DVector | getWorldUpperLeft () |
Virtual plane upper left position in world space. More... | |
void | init (StubElement stub) |
Initialize element from stub. More... | |
bool | isInsidePlane (Vector2 position) |
Determines if virtual plane coordinates are inside virtual plane. More... | |
void | leftMouseClick () |
Simulate left mouse button click on desktop at current desktop mouse location. More... | |
void | leftMousePress () |
Simulate left mouse button press on desktop at current desktop mouse location. More... | |
void | leftMouseRelease () |
Simulate left mouse button release on desktop at current desktop mouse location. More... | |
void | mouseClick (int button) |
Simulate mouse button click on desktop at current desktop mouse location. More... | |
void | mousePress (int button) |
Simulate mouse button press on desktop at current desktop mouse location. More... | |
void | mouseRelease (int button) |
Simulate mouse button release on desktop at current desktop mouse location. More... | |
bool | moveMouse (DVector worldPosition) |
Move mouse position if world position is inside virtual plane. More... | |
void | moveMouse (Point position) |
Move desktop mouse to new position. More... | |
void | moveMouseEverywhere (DVector worldPosition) |
Move mouse position. More... | |
void | moveMouseRay (DVector origin, DVector direction) |
Move mouse position. More... | |
Instance | new (ECBehaviorControlDesktop ecbehavior, BehaviorElement element) |
Create element. More... | |
Vector2 | planePosition (DVector worldPosition) |
Calculate virtual plane coordinates for world position or null if outside. More... | |
Vector2 | planePositionEverywhere (DVector worldPosition) |
Calculate virtual plane coordinates for world position. More... | |
Vector2 | planePositionRay (DVector origin, DVector direction) |
Calculate virtual plane coordinates for world ray intersection with plan. More... | |
Point | planeToDesktop (Vector2 position) |
Calculate desktop position from virtual plane coordinates. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance | |
void | addToGameWorld () |
Add element to game world. More... | |
void | attachToParent (Element parent) |
Attach element to object set by the mapper in the IGDE World Editor. More... | |
void | enterFrame () |
Frame update started. More... | |
void | geometryChanged () |
Position or orientation changed. More... | |
BehaviorElement | getElement () |
Behavior element to apply behavior to. More... | |
int | getInstanceIndex () |
Behavior instance index. More... | |
DefaultECBehaviorInstance | new (BehaviorElement element) |
Create default composeable instance. More... | |
void | postThink (float elapsed) |
Post thinking after physics processing is finished. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read behavior instance from file. More... | |
void | removeFromGameWorld () |
Remove element from game world. More... | |
bool | requiresEnterFrame () |
Behavior instance requires enterFrame() to be called. More... | |
bool | requiresThink () |
Behavior instance requires think() to be called. More... | |
void | stateChanged () |
State changed (visble, touchable). More... | |
void | think (float elapsed) |
Think about what to do for the next frame update. More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write behavior instance to file. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance | |
void | setRequiresEnterFrame (bool required) |
Set if behavior instance requires enterFrame() to be called. More... | |
void | setRequiresThink (bool required) |
Set if behavior instance requires think() to be called. More... | |
Behavior instance.
Point Dragengine.Scenery.ECBehaviorControlDesktop.Instance.desktopPoint | ( | DVector | worldPosition | ) |
Calculate desktop position for world position or null if outside.
Convenience method for calling planePosition() then planeToDesktop() if virtual plane position is not null.
Point Dragengine.Scenery.ECBehaviorControlDesktop.Instance.desktopPointEverywhere | ( | DVector | worldPosition | ) |
Calculate desktop position for world position.
Same as desktopPoint() but returns desktop position also if the world position is outside the virtual plane. The returned position is clamped to the desktop size.
Point Dragengine.Scenery.ECBehaviorControlDesktop.Instance.desktopPointRay | ( | DVector | origin, |
DVector | direction | ||
) |
Calculate desktop position for world ray intersection.
Same as desktopPoint() but returns desktop position also if the world position is outside the virtual plane. The returned position is clamped to the desktop size.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.dispose | ( | ) |
Dispose of behavior instance.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
String Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getBone | ( | ) |
Bone name or empty string if not set.
ECBehaviorControlDesktop Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getECBehavior | ( | ) |
Behavior.
Vector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getLowerLeft | ( | ) |
Virtual plane lower left position.
Vector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getLowerRight | ( | ) |
Virtual plane lower right position.
ECBehaviorRenderableDesktop.Instance Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getRenderableDesktop | ( | ) |
Renderable desktop behavior instance.
Vector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getUpperLeft | ( | ) |
Virtual plane upper left position.
DVector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldLowerLeft | ( | ) |
Virtual plane lower left position in world space.
DVector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldLowerRight | ( | ) |
Virtual plane lower right position in world space.
DMatrix Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldMatrix | ( | ) |
Virtual plane matrix in world space.
DVector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldUpperLeft | ( | ) |
Virtual plane upper left position in world space.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.init | ( | StubElement | stub | ) |
Initialize element from stub.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
bool Dragengine.Scenery.ECBehaviorControlDesktop.Instance.isInsidePlane | ( | Vector2 | position | ) |
Determines if virtual plane coordinates are inside virtual plane.
Typically used with position returned by planePositionEverywhere(). The position returned by planePosition() is guaranteed to be inside the virtual plane.
Returns true if position is inside the inclusive range from (0,0) to (1,1).
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.leftMouseClick | ( | ) |
Simulate left mouse button click on desktop at current desktop mouse location.
Sends mouse pressed event immediately followed by a mouse release event.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.leftMousePress | ( | ) |
Simulate left mouse button press on desktop at current desktop mouse location.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.leftMouseRelease | ( | ) |
Simulate left mouse button release on desktop at current desktop mouse location.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.mouseClick | ( | int | button | ) |
Simulate mouse button click on desktop at current desktop mouse location.
Sends mouse pressed event immediately followed by a mouse release event.
button | Button to click. Value from InputEventMouseButton. |
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.mousePress | ( | int | button | ) |
Simulate mouse button press on desktop at current desktop mouse location.
button | Button to press. Value from InputEventMouseButton. |
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.mouseRelease | ( | int | button | ) |
Simulate mouse button release on desktop at current desktop mouse location.
button | Button to release. Value from InputEventMouseButton. |
bool Dragengine.Scenery.ECBehaviorControlDesktop.Instance.moveMouse | ( | DVector | worldPosition | ) |
Move mouse position if world position is inside virtual plane.
Convenience method for calling desktopPoint() then moveMouse() if desktop point is not null.
Returns true if the world position is inside the virtual plane.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.moveMouse | ( | Point | position | ) |
Move desktop mouse to new position.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.moveMouseEverywhere | ( | DVector | worldPosition | ) |
Move mouse position.
Same as moveMouse(DVector) but applies also if world position is outside virtual plane.
void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.moveMouseRay | ( | DVector | origin, |
DVector | direction | ||
) |
Move mouse position.
Same as moveMouse(DVector) but applies also if world position is outside virtual plane.
Instance Dragengine.Scenery.ECBehaviorControlDesktop.Instance.new | ( | ECBehaviorControlDesktop | ecbehavior, |
BehaviorElement | element | ||
) |
Create element.
Calculate virtual plane coordinates for world position or null if outside.
If the world position is not on the virtual plane the position is projected down to the virtual plane along the virtual plane normal.
The virtual plane coordinates map the lower left corner to (0,0), the lower right corner to (1,0) and the upper left corner to (0,1).
Vector2 Dragengine.Scenery.ECBehaviorControlDesktop.Instance.planePositionEverywhere | ( | DVector | worldPosition | ) |
Calculate virtual plane coordinates for world position.
Same as planePosition() but always returns also plane positions outside the virtual plane. This is useful if the player simulated a mouse click event but not yet a mouse released event. Tracking the virtual plane position outside the virtual plane allows then to provide a reasonable mouse position until the mouse release event is simulated
Vector2 Dragengine.Scenery.ECBehaviorControlDesktop.Instance.planePositionRay | ( | DVector | origin, |
DVector | direction | ||
) |
Calculate virtual plane coordinates for world ray intersection with plan.
Calculates the intersection point of the ray with the plane. Returns position similar to planePositionEverywhere without clamping.
Point Dragengine.Scenery.ECBehaviorControlDesktop.Instance.planeToDesktop | ( | Vector2 | position | ) |
Calculate desktop position from virtual plane coordinates.
Virtual plane Y axis runs from bottom (0) to top(1). Desktop Y axis runs from top (0) to bottom (height-1).
Returned position is clamped to desktop size.