C# Класс geek.GameEngine.Visuals.InteractableObject

The class that defines an object that can test for collisions and UI interaction.
Наследование: DynamicObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DebugOutput bool
IsTouchable bool
TouchMode TouchMode

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
InteractableObject ( ) : System.Diagnostics

Приватные методы

Метод Описание
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.

Описание методов

Draw() публичный Метод

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
Результат void

EntersPlayfield() публичный Метод

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.
Результат bool

EntersRect() публичный Метод

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.
Результат bool

EntersScreen() публичный Метод

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.
Результат bool

InteractableObject() защищенный Метод

protected InteractableObject ( ) : System.Diagnostics
Результат System.Diagnostics

IsClicked() публичный Метод

Check if the user has released the tap on the object. Fires once per release.
public IsClicked ( ) : bool
Результат bool

IsInsideRect() публичный Метод

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.
Результат bool

IsOffPlayfield() публичный Метод

Checks whether the object is fully outside the playfield of current level.
public IsOffPlayfield ( ) : bool
Результат bool

IsOffScreen() публичный Метод

Checks whether the object is fully invisible.
public IsOffScreen ( ) : bool
Результат bool

IsOnPlayfield() публичный Метод

Checks whether the object is fully inside the playfield of current level.
public IsOnPlayfield ( ) : bool
Результат bool

IsOnScreen() публичный Метод

Checks whether the object is fully inside the screen.
public IsOnScreen ( ) : bool
Результат bool

IsOutsideRect() публичный Метод

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.
Результат bool

IsOverlappedWith() публичный Метод

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.
Результат bool

IsPressed() публичный Метод

Check if the user has pressed the object with their finger. Fires continuosly until the finger is released.
public IsPressed ( ) : bool
Результат bool

IsTapped() публичный Метод

Check if the object has been tapped. Fires once per tap & hold.
public IsTapped ( ) : bool
Результат bool

LeavesPlayfield() публичный Метод

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.
Результат bool

LeavesRect() публичный Метод

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.
Результат bool

LeavesScreen() публичный Метод

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.
Результат bool

Update() публичный Метод

public Update ( ) : void
Результат void

Описание свойств

DebugOutput публичное свойство

Enables or disables bounding box drawing.
public bool DebugOutput
Результат bool

IsTouchable публичное свойство

Enables or disables touch panel querying.
public bool IsTouchable
Результат bool

TouchMode публичное свойство

Gets or sets the touch handling mode.
public TouchMode TouchMode
Результат TouchMode