Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorControlDesktop.Instance Class Reference

Behavior instance. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorControlDesktop.Instance:
Dragengine.Scenery.DefaultECBehaviorInstance Dragengine.Scenery.ECBehaviorInstance

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

Detailed Description

Behavior instance.

Member Function Documentation

◆ desktopPoint()

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.

◆ desktopPointEverywhere()

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.

◆ desktopPointRay()

Point Dragengine.Scenery.ECBehaviorControlDesktop.Instance.desktopPointRay ( DVector  origin,
DVector  direction 
)

Calculate desktop position for world ray intersection.

Version
1.9

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.

◆ dispose()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.dispose ( )

Dispose of behavior instance.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ getBone()

String Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getBone ( )

Bone name or empty string if not set.

◆ getECBehavior()

ECBehaviorControlDesktop Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getECBehavior ( )

Behavior.

◆ getLowerLeft()

Vector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getLowerLeft ( )

Virtual plane lower left position.

◆ getLowerRight()

Vector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getLowerRight ( )

Virtual plane lower right position.

◆ getRenderableDesktop()

ECBehaviorRenderableDesktop.Instance Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getRenderableDesktop ( )

Renderable desktop behavior instance.

◆ getUpperLeft()

Vector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getUpperLeft ( )

Virtual plane upper left position.

◆ getWorldLowerLeft()

DVector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldLowerLeft ( )

Virtual plane lower left position in world space.

◆ getWorldLowerRight()

DVector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldLowerRight ( )

Virtual plane lower right position in world space.

◆ getWorldMatrix()

DMatrix Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldMatrix ( )

Virtual plane matrix in world space.

◆ getWorldUpperLeft()

DVector Dragengine.Scenery.ECBehaviorControlDesktop.Instance.getWorldUpperLeft ( )

Virtual plane upper left position in world space.

◆ init()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.init ( StubElement  stub)

Initialize element from stub.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ isInsidePlane()

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

◆ leftMouseClick()

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.

◆ leftMousePress()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.leftMousePress ( )

Simulate left mouse button press on desktop at current desktop mouse location.

◆ leftMouseRelease()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.leftMouseRelease ( )

Simulate left mouse button release on desktop at current desktop mouse location.

◆ mouseClick()

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.

Parameters
buttonButton to click. Value from InputEventMouseButton.

◆ mousePress()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.mousePress ( int  button)

Simulate mouse button press on desktop at current desktop mouse location.

Parameters
buttonButton to press. Value from InputEventMouseButton.

◆ mouseRelease()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.mouseRelease ( int  button)

Simulate mouse button release on desktop at current desktop mouse location.

Parameters
buttonButton to release. Value from InputEventMouseButton.

◆ moveMouse() [1/2]

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.

◆ moveMouse() [2/2]

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.moveMouse ( Point  position)

Move desktop mouse to new position.

◆ moveMouseEverywhere()

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.

◆ moveMouseRay()

void Dragengine.Scenery.ECBehaviorControlDesktop.Instance.moveMouseRay ( DVector  origin,
DVector  direction 
)

Move mouse position.

Version
1.9

Same as moveMouse(DVector) but applies also if world position is outside virtual plane.

◆ new()

Instance Dragengine.Scenery.ECBehaviorControlDesktop.Instance.new ( ECBehaviorControlDesktop  ecbehavior,
BehaviorElement  element 
)

Create element.

◆ planePosition()

Vector2 Dragengine.Scenery.ECBehaviorControlDesktop.Instance.planePosition ( DVector  worldPosition)

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

◆ planePositionEverywhere()

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

◆ planePositionRay()

Vector2 Dragengine.Scenery.ECBehaviorControlDesktop.Instance.planePositionRay ( DVector  origin,
DVector  direction 
)

Calculate virtual plane coordinates for world ray intersection with plan.

Version
1.9

Calculates the intersection point of the ray with the plane. Returns position similar to planePositionEverywhere without clamping.

◆ planeToDesktop()

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.


The documentation for this class was generated from the following file: