C# Class geek.GameEngine.Visuals.InteractableObject

The class that defines an object that can test for collisions and UI interaction.
Inheritance: DynamicObject
Mostra file Open project: impworks/xna.geek.engine Class Usage Examples

Public Properties

Property Type Description
DebugOutput bool
IsTouchable bool
TouchMode TouchMode

Public Methods

Method Description
Draw ( SpriteBatch batch ) : void
EntersPlayfield ( RectSide side ) : bool

Checks if the object has just entered the playfield. The object must enter it naturally using it's momentum.

EntersRect ( RectSide side, Rectangle rect, bool absolute ) : bool

Checks whether the object enters a rectangle.

EntersScreen ( RectSide side ) : bool

Checks if the object has just entered the screen. The object must enter it naturally using it's momentum.

IsClicked ( ) : bool

Check if the user has released the tap on the object. Fires once per release.

IsInsideRect ( Rectangle rect, bool absolute = false ) : bool

Checks whether this object is inside a rectangle.

IsOffPlayfield ( ) : bool

Checks whether the object is fully outside the playfield of current level.

IsOffScreen ( ) : bool

Checks whether the object is fully invisible.

IsOnPlayfield ( ) : bool

Checks whether the object is fully inside the playfield of current level.

IsOnScreen ( ) : bool

Checks whether the object is fully inside the screen.

IsOutsideRect ( Rectangle rect, bool absolute = false ) : bool

Checks whether this object is inside a rectangle.

IsOverlappedWith ( InteractableObject obj ) : bool

Check whether an object collides with another object. Collision is rectangle based and non-rotatable.

IsPressed ( ) : bool

Check if the user has pressed the object with their finger. Fires continuosly until the finger is released.

IsTapped ( ) : bool

Check if the object has been tapped. Fires once per tap & hold.

LeavesPlayfield ( RectSide side ) : bool

Checks if the object has just left the playfield. The object must leave it naturally using it's momentum.

LeavesRect ( RectSide side, Rectangle rect, bool absolute ) : bool

Checks whether the object leaves a rectangle.

LeavesScreen ( RectSide side ) : bool

Checks if the object has just left the screen. The object must leave it naturally using it's momentum.

Update ( ) : void

Protected Methods

Method Description
InteractableObject ( ) : System.Diagnostics

Private Methods

Method Description
drawBoundingBox ( ) : void

Draws the bounding box on screen.

drawHotSpot ( ) : void

Draws the cross where the hot spot of the object is located.

entersRectFromBottom ( Rectangle rect, Rectangle box ) : bool

Checks if the object enters a specific rectangle from the bottom.

entersRectFromLeft ( Rectangle rect, Rectangle box ) : bool

Checks if the object enters a specific rectangle from the left.

entersRectFromRight ( Rectangle rect, Rectangle box ) : bool

Checks if the object enters a specific rectangle from the right.

entersRectFromTop ( Rectangle rect, Rectangle box ) : bool

Checks if the object enters a specific rectangle from the top.

findTouch ( Rectangle zone ) : TouchLocation?

Find a touch location that matches the current object.

leavesRectFromBottom ( Rectangle rect, Rectangle box ) : bool

Checks if the object leaves a specific rectangle to the bottom.

leavesRectFromLeft ( Rectangle rect, Rectangle box ) : bool

Checks if the object leaves a specific rectangle to the left.

leavesRectFromRight ( Rectangle rect, Rectangle box ) : bool

Checks if the object leaves a specific rectangle to the right.

leavesRectFromTop ( Rectangle rect, Rectangle box ) : bool

Checks if the object leaves a specific rectangle to the top.

Method Details

Draw() public method

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

EntersPlayfield() public method

Checks if the object has just entered the playfield. The object must enter it naturally using it's momentum.
public EntersPlayfield ( RectSide side ) : bool
side RectSide Side of the screen.
return bool

EntersRect() public method

Checks whether the object enters a rectangle.
public EntersRect ( RectSide side, Rectangle rect, bool absolute ) : bool
side RectSide Rectangle side.
rect Microsoft.Xna.Framework.Rectangle Rectangle.
absolute bool Flag indicating whether rectangle coordinates are screen-bound or playfield-bound.
return bool

EntersScreen() public method

Checks if the object has just entered the screen. The object must enter it naturally using it's momentum.
public EntersScreen ( RectSide side ) : bool
side RectSide Side of the screen.
return bool

InteractableObject() protected method

protected InteractableObject ( ) : System.Diagnostics
return System.Diagnostics

IsClicked() public method

Check if the user has released the tap on the object. Fires once per release.
public IsClicked ( ) : bool
return bool

IsInsideRect() public method

Checks whether this object is inside a rectangle.
public IsInsideRect ( Rectangle rect, bool absolute = false ) : bool
rect Microsoft.Xna.Framework.Rectangle Rectangle to test.
absolute bool Absolute or relative coordinates.
return bool

IsOffPlayfield() public method

Checks whether the object is fully outside the playfield of current level.
public IsOffPlayfield ( ) : bool
return bool

IsOffScreen() public method

Checks whether the object is fully invisible.
public IsOffScreen ( ) : bool
return bool

IsOnPlayfield() public method

Checks whether the object is fully inside the playfield of current level.
public IsOnPlayfield ( ) : bool
return bool

IsOnScreen() public method

Checks whether the object is fully inside the screen.
public IsOnScreen ( ) : bool
return bool

IsOutsideRect() public method

Checks whether this object is inside a rectangle.
public IsOutsideRect ( Rectangle rect, bool absolute = false ) : bool
rect Microsoft.Xna.Framework.Rectangle Rectangle to test.
absolute bool Absolute or relative coordinates.
return bool

IsOverlappedWith() public method

Check whether an object collides with another object. Collision is rectangle based and non-rotatable.
public IsOverlappedWith ( InteractableObject obj ) : bool
obj InteractableObject Object to test collision to.
return bool

IsPressed() public method

Check if the user has pressed the object with their finger. Fires continuosly until the finger is released.
public IsPressed ( ) : bool
return bool

IsTapped() public method

Check if the object has been tapped. Fires once per tap & hold.
public IsTapped ( ) : bool
return bool

LeavesPlayfield() public method

Checks if the object has just left the playfield. The object must leave it naturally using it's momentum.
public LeavesPlayfield ( RectSide side ) : bool
side RectSide Side of the playfield.
return bool

LeavesRect() public method

Checks whether the object leaves a rectangle.
public LeavesRect ( RectSide side, Rectangle rect, bool absolute ) : bool
side RectSide Rectangle side.
rect Microsoft.Xna.Framework.Rectangle Rectangle.
absolute bool Flag indicating whether rectangle coordinates are screen-bound or playfield-bound.
return bool

LeavesScreen() public method

Checks if the object has just left the screen. The object must leave it naturally using it's momentum.
public LeavesScreen ( RectSide side ) : bool
side RectSide Side of the screen.
return bool

Update() public method

public Update ( ) : void
return void

Property Details

DebugOutput public_oe property

Enables or disables bounding box drawing.
public bool DebugOutput
return bool

IsTouchable public_oe property

Enables or disables touch panel querying.
public bool IsTouchable
return bool

TouchMode public_oe property

Gets or sets the touch handling mode.
public TouchMode TouchMode
return TouchMode