C# Класс PlatformerPOC.Renderer

Centralized rendering and viewport implementation.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

Private Properties

Свойство Тип Описание
DrawAll void
DrawBorder void
DrawDebug void
DrawHud void
GetRelativeCoords Microsoft.Xna.Framework.Rectangle
GetRelativeCoords Vector2
GetSpriteEffects SpriteEffects
IsObjectInArea bool
IsObjectInView bool

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

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

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

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

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

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

Single public method
public Draw ( ) : void
Результат void

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

Converts view coordinates into world coordinates
public GetWorldCoords ( Vector2 viewCoords ) : Vector2
viewCoords Vector2
Результат Vector2

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

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

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

public Renderer ( PlatformGame game ) : System
game PlatformGame
Результат System

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

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

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

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

public SpriteBatch,Microsoft.Xna.Framework.Graphics spriteBatch
Результат Microsoft.Xna.Framework.Graphics.SpriteBatch