C# Class geek.GameEngine.Visuals.InteractableObject

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

Méthodes publiques

Свойство Type Description
DebugOutput bool
IsTouchable bool
TouchMode TouchMode

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
InteractableObject ( ) : System.Diagnostics

Private Methods

Méthode 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 méthode

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
Résultat void

EntersPlayfield() public méthode

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.
Résultat bool

EntersRect() public méthode

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.
Résultat bool

EntersScreen() public méthode

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.
Résultat bool

InteractableObject() protected méthode

protected InteractableObject ( ) : System.Diagnostics
Résultat System.Diagnostics

IsClicked() public méthode

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

IsInsideRect() public méthode

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.
Résultat bool

IsOffPlayfield() public méthode

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

IsOffScreen() public méthode

Checks whether the object is fully invisible.
public IsOffScreen ( ) : bool
Résultat bool

IsOnPlayfield() public méthode

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

IsOnScreen() public méthode

Checks whether the object is fully inside the screen.
public IsOnScreen ( ) : bool
Résultat bool

IsOutsideRect() public méthode

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.
Résultat bool

IsOverlappedWith() public méthode

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.
Résultat bool

IsPressed() public méthode

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

IsTapped() public méthode

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

LeavesPlayfield() public méthode

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.
Résultat bool

LeavesRect() public méthode

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.
Résultat bool

LeavesScreen() public méthode

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.
Résultat bool

Update() public méthode

public Update ( ) : void
Résultat void

Property Details

DebugOutput public_oe property

Enables or disables bounding box drawing.
public bool DebugOutput
Résultat bool

IsTouchable public_oe property

Enables or disables touch panel querying.
public bool IsTouchable
Résultat bool

TouchMode public_oe property

Gets or sets the touch handling mode.
public TouchMode TouchMode
Résultat TouchMode