C# Class PlatformerPOC.Renderer

Centralized rendering and viewport implementation.
Afficher le fichier Open project: bramdemoor/MonoGame-PlatformerPOC Class Usage Examples

Méthodes publiques

Свойство Type Description
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

Private Properties

Свойство Type Description
DrawAll void
DrawBorder void
DrawDebug void
DrawHud void
GetRelativeCoords Microsoft.Xna.Framework.Rectangle
GetRelativeCoords Vector2
GetSpriteEffects SpriteEffects
IsObjectInArea bool
IsObjectInView bool

Méthodes publiques

Méthode Description
Draw ( ) : void

Single public method

GetWorldCoords ( Vector2 viewCoords ) : Vector2

Converts view coordinates into world coordinates

LoadContent ( ) : void
Renderer ( PlatformGame game ) : System
UpdateCameraPosition ( float x, GameTime gameTime ) : void

Scroll the view to a specified horizontal coordinate. Optionally, apply camera shake effect FYI V-scrolling is blocked

Private Methods

Méthode Description
DrawAll ( ) : void
DrawBorder ( Rectangle rectangleToDraw, int thicknessOfBorder, Color borderColor ) : void

Will draw a border (hollow rectangle) of the given 'thicknessOfBorder' (in pixels) of the specified color. Order: Top > Left > Right > Bottom By Sean Colombo, from http://bluelinegamestudios.com/blog

DrawDebug ( ) : void
DrawHud ( ) : void
GetRelativeCoords ( Rectangle realWorldRectangle ) : Rectangle

Converts world rectangle into view rectangle

GetRelativeCoords ( Vector2 realWorldCoords ) : Vector2

Converts world coordinates into view coordinates

GetSpriteEffects ( HorizontalDirection horizontalDirection ) : SpriteEffects
IsObjectInArea ( Rectangle objectRectangle ) : bool
IsObjectInView ( BaseGameObject obj ) : bool

Method Details

Draw() public méthode

Single public method
public Draw ( ) : void
Résultat void

GetWorldCoords() public méthode

Converts view coordinates into world coordinates
public GetWorldCoords ( Vector2 viewCoords ) : Vector2
viewCoords Vector2
Résultat Vector2

LoadContent() public méthode

public LoadContent ( ) : void
Résultat void

Renderer() public méthode

public Renderer ( PlatformGame game ) : System
game PlatformGame
Résultat System

UpdateCameraPosition() public méthode

Scroll the view to a specified horizontal coordinate. Optionally, apply camera shake effect FYI V-scrolling is blocked
public UpdateCameraPosition ( float x, GameTime gameTime ) : void
x float
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

Property Details

spriteBatch public_oe property

public SpriteBatch,Microsoft.Xna.Framework.Graphics spriteBatch
Résultat Microsoft.Xna.Framework.Graphics.SpriteBatch