C# Class SmashBros.Controllers.ImageController

ImageController Controls one image but can have many positions And different animations on differente positions
Inheritance: Controller
Afficher le fichier Open project: Grutn/TDT4240-X2 Class Usage Examples

Méthodes publiques

Свойство Type Description
OriginDefault Vector2
ScaleDefault float

Méthodes publiques

Méthode Description
AddPosition ( Vector2 pos, int posId = -1 ) : ImageModel
AddPosition ( float x, float y, int posId = -1 ) : ImageModel
Animate ( ImageModel model, Vector2 toPos, float timeInMs, bool loop, float toScale = 1f ) : void
Animate ( ImageModel model, float toX, float toY, float timeInMs, bool loop = false, float toScale = 1f ) : void

Animates texture at positionIndex

Animate ( float toX, float toY, float timeInMs, bool loop = false, float scale = 1f ) : void
Animate ( int posIndex, Vector2 toPos, float timeInMs, bool loop = false, float scale = 1f ) : void
Animate ( int posIndex, float toX, float toY, float timeInMs, bool loop = false, float scale = 1f ) : void
AnimateFrame ( ImageModel model, int startFrame, int endFrame, int fps, bool loop = true ) : void
AnimatePos ( ImageModel model, float toX, float toY, float timeInMs, bool loop = false ) : void

Annimates the given model to the given position(x,y)

AnimatePos ( float toX, float toY, float timeInMs, bool loop = false ) : void

Anniates the first model (if exists) instance to given position(x,y)

AnimateScale ( ImageModel model, float toScale, float timeInMs, bool loop = false ) : void

Annimates the given model to the given scale

AnimateScale ( float toScale, float timeInMs, bool loop = false ) : void

Anniates the first model(if exists) instance to given scale

AnimateScale ( int posIndex, float scale, float time, bool loop = false ) : void
Deactivate ( ) : void
EmptyList ( ) : void
GetAt ( int index ) : ImageModel

Gets the model at index

ImageController ( ScreenManager screen, string assetName, Vector2 pos, int layer, bool staticPosition = false ) : System
ImageController ( ScreenManager screen, string assetName, int layer, bool staticPosition = false ) : System
Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
OnNext ( GameStateManager value ) : void
RemoveId ( int id ) : void
RemovePosition ( ImageModel pos ) : void
RemovePosition ( int index ) : void
SetFps ( ImageModel model, int fps ) : void
SetFps ( int fps ) : void

Sets frames per second for first instance in models

SetFrame ( ImageModel model, int frame ) : void

Set current frame at given image model

SetFrame ( int frame ) : void

Set frame at first instance in model list if exists

SetFrameRectangle ( int widht, int height ) : void
SetPosition ( Vector2 pos ) : ImageModel

Remove all other image models and create new model with position

SetPosition ( int x, int y ) : ImageModel

Remove all other image models and create new model with position

Unload ( ) : void
Update ( GameTime gameTime ) : void

Private Methods

Méthode Description
updateAnimation ( GameTime gameTime, ImageModel model ) : bool

Method Details

AddPosition() public méthode

public AddPosition ( Vector2 pos, int posId = -1 ) : ImageModel
pos Vector2
posId int
Résultat SmashBros.Models.ImageModel

AddPosition() public méthode

public AddPosition ( float x, float y, int posId = -1 ) : ImageModel
x float
y float
posId int
Résultat SmashBros.Models.ImageModel

Animate() public méthode

public Animate ( ImageModel model, Vector2 toPos, float timeInMs, bool loop, float toScale = 1f ) : void
model SmashBros.Models.ImageModel
toPos Vector2
timeInMs float
loop bool
toScale float
Résultat void

Animate() public méthode

Animates texture at positionIndex
public Animate ( ImageModel model, float toX, float toY, float timeInMs, bool loop = false, float toScale = 1f ) : void
model SmashBros.Models.ImageModel
toX float
toY float
timeInMs float Time to use to animate
loop bool
toScale float
Résultat void

Animate() public méthode

public Animate ( float toX, float toY, float timeInMs, bool loop = false, float scale = 1f ) : void
toX float
toY float
timeInMs float
loop bool
scale float
Résultat void

Animate() public méthode

public Animate ( int posIndex, Vector2 toPos, float timeInMs, bool loop = false, float scale = 1f ) : void
posIndex int
toPos Vector2
timeInMs float
loop bool
scale float
Résultat void

Animate() public méthode

public Animate ( int posIndex, float toX, float toY, float timeInMs, bool loop = false, float scale = 1f ) : void
posIndex int
toX float
toY float
timeInMs float
loop bool
scale float
Résultat void

AnimateFrame() public méthode

public AnimateFrame ( ImageModel model, int startFrame, int endFrame, int fps, bool loop = true ) : void
model SmashBros.Models.ImageModel
startFrame int
endFrame int
fps int
loop bool
Résultat void

AnimatePos() public méthode

Annimates the given model to the given position(x,y)
public AnimatePos ( ImageModel model, float toX, float toY, float timeInMs, bool loop = false ) : void
model SmashBros.Models.ImageModel
toX float
toY float
timeInMs float
loop bool
Résultat void

AnimatePos() public méthode

Anniates the first model (if exists) instance to given position(x,y)
public AnimatePos ( float toX, float toY, float timeInMs, bool loop = false ) : void
toX float
toY float
timeInMs float
loop bool
Résultat void

AnimateScale() public méthode

Annimates the given model to the given scale
public AnimateScale ( ImageModel model, float toScale, float timeInMs, bool loop = false ) : void
model SmashBros.Models.ImageModel
toScale float
timeInMs float
loop bool
Résultat void

AnimateScale() public méthode

Anniates the first model(if exists) instance to given scale
public AnimateScale ( float toScale, float timeInMs, bool loop = false ) : void
toScale float
timeInMs float
loop bool
Résultat void

AnimateScale() public méthode

public AnimateScale ( int posIndex, float scale, float time, bool loop = false ) : void
posIndex int
scale float
time float
loop bool
Résultat void

Deactivate() public méthode

public Deactivate ( ) : void
Résultat void

EmptyList() public méthode

public EmptyList ( ) : void
Résultat void

GetAt() public méthode

Gets the model at index
public GetAt ( int index ) : ImageModel
index int
Résultat SmashBros.Models.ImageModel

ImageController() public méthode

public ImageController ( ScreenManager screen, string assetName, Vector2 pos, int layer, bool staticPosition = false ) : System
screen SmashBros.MySystem.ScreenManager
assetName string
pos Vector2
layer int
staticPosition bool
Résultat System

ImageController() public méthode

public ImageController ( ScreenManager screen, string assetName, int layer, bool staticPosition = false ) : System
screen SmashBros.MySystem.ScreenManager
assetName string
layer int
staticPosition bool
Résultat System

Load() public méthode

public Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
Résultat void

OnNext() public méthode

public OnNext ( GameStateManager value ) : void
value GameStateManager
Résultat void

RemoveId() public méthode

public RemoveId ( int id ) : void
id int
Résultat void

RemovePosition() public méthode

public RemovePosition ( ImageModel pos ) : void
pos SmashBros.Models.ImageModel
Résultat void

RemovePosition() public méthode

public RemovePosition ( int index ) : void
index int
Résultat void

SetFps() public méthode

public SetFps ( ImageModel model, int fps ) : void
model SmashBros.Models.ImageModel
fps int
Résultat void

SetFps() public méthode

Sets frames per second for first instance in models
public SetFps ( int fps ) : void
fps int
Résultat void

SetFrame() public méthode

Set current frame at given image model
public SetFrame ( ImageModel model, int frame ) : void
model SmashBros.Models.ImageModel
frame int
Résultat void

SetFrame() public méthode

Set frame at first instance in model list if exists
public SetFrame ( int frame ) : void
frame int
Résultat void

SetFrameRectangle() public méthode

public SetFrameRectangle ( int widht, int height ) : void
widht int
height int
Résultat void

SetPosition() public méthode

Remove all other image models and create new model with position
public SetPosition ( Vector2 pos ) : ImageModel
pos Vector2
Résultat SmashBros.Models.ImageModel

SetPosition() public méthode

Remove all other image models and create new model with position
public SetPosition ( int x, int y ) : ImageModel
x int
y int
Résultat SmashBros.Models.ImageModel

Unload() public méthode

public Unload ( ) : void
Résultat void

Update() public méthode

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

Property Details

OriginDefault public_oe property

Default origin point
public Vector2 OriginDefault
Résultat Vector2

ScaleDefault public_oe property

Default scale when add a position
public float ScaleDefault
Résultat float