C# Class MyPolarBear.EntityHelper

Afficher le fichier Open project: sgdc/sgdc-old

Méthodes publiques

Méthode Description
AngleBetween ( Vector2 firstVector, Vector2 secondVector ) : float
CollisionBoxFromTexture ( Vector2 position, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 origin, float scale ) : Rectangle
DistanceBetween ( Vector2 firstVector, Vector2 secondVector ) : float
LevelBounce ( Rectangle EntityCollisionBox, Rectangle LevelCollisionBox, float Bounciness ) : Vector2
MoveBackOnScreen ( Rectangle EntityCollisionBox, Rectangle ScreenCollisionBox ) : Vector2
OriginFromTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Vector2

Returns a vector at the center of the given texture.

UpdateCollisionBox ( Rectangle collisionBox, Vector2 position, Vector2 origin, float scale ) : Rectangle
WallBounce ( Rectangle EntityCollisionBox, Rectangle WallCollisionBox, float Bounciness ) : Vector2

Method Details

AngleBetween() public static méthode

public static AngleBetween ( Vector2 firstVector, Vector2 secondVector ) : float
firstVector Vector2
secondVector Vector2
Résultat float

CollisionBoxFromTexture() public static méthode

public static CollisionBoxFromTexture ( Vector2 position, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 origin, float scale ) : Rectangle
position Vector2
texture Microsoft.Xna.Framework.Graphics.Texture2D
origin Vector2
scale float
Résultat Microsoft.Xna.Framework.Rectangle

DistanceBetween() public static méthode

public static DistanceBetween ( Vector2 firstVector, Vector2 secondVector ) : float
firstVector Vector2
secondVector Vector2
Résultat float

LevelBounce() public static méthode

public static LevelBounce ( Rectangle EntityCollisionBox, Rectangle LevelCollisionBox, float Bounciness ) : Vector2
EntityCollisionBox Microsoft.Xna.Framework.Rectangle
LevelCollisionBox Microsoft.Xna.Framework.Rectangle
Bounciness float
Résultat Vector2

MoveBackOnScreen() public static méthode

public static MoveBackOnScreen ( Rectangle EntityCollisionBox, Rectangle ScreenCollisionBox ) : Vector2
EntityCollisionBox Microsoft.Xna.Framework.Rectangle
ScreenCollisionBox Microsoft.Xna.Framework.Rectangle
Résultat Vector2

OriginFromTexture() public static méthode

Returns a vector at the center of the given texture.
public static OriginFromTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Vector2
texture Microsoft.Xna.Framework.Graphics.Texture2D The texture to find the origin of.
Résultat Vector2

UpdateCollisionBox() public static méthode

public static UpdateCollisionBox ( Rectangle collisionBox, Vector2 position, Vector2 origin, float scale ) : Rectangle
collisionBox Microsoft.Xna.Framework.Rectangle
position Vector2
origin Vector2
scale float
Résultat Microsoft.Xna.Framework.Rectangle

WallBounce() public static méthode

public static WallBounce ( Rectangle EntityCollisionBox, Rectangle WallCollisionBox, float Bounciness ) : Vector2
EntityCollisionBox Microsoft.Xna.Framework.Rectangle
WallCollisionBox Microsoft.Xna.Framework.Rectangle
Bounciness float
Résultat Vector2