C# Класс manlyMiniGames.Map

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
center Vector2

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

Метод Описание
Draw ( SpriteBatch batch ) : void
LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void

Loading the textures

Map ( ) : System
drawOnMap ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D tex, Vector2 pos ) : void

Renders a texture onto the map using the given spritebatch and map position

screenToWorld ( Vector2 pos ) : Vector2

Returns the world position relative to the screen position given

setViewPos ( Vector2 pos ) : void

Center the screen on the given world coordinate

worldToScreen ( Vector2 pos ) : Vector2

Returns the screen position matching the given world position

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

Метод Описание
Grid ( int x, int y ) : UInt16

Returns the grid at the relative position with bounds checking

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

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

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

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

Loading the textures
public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager The manager handling the textures
Результат void

Map() публичный метод

public Map ( ) : System
Результат System

drawOnMap() публичный метод

Renders a texture onto the map using the given spritebatch and map position
public drawOnMap ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D tex, Vector2 pos ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch to render the texture
tex Microsoft.Xna.Framework.Graphics.Texture2D Texture we want to render
pos Vector2
Результат void

screenToWorld() публичный метод

Returns the world position relative to the screen position given
public screenToWorld ( Vector2 pos ) : Vector2
pos Vector2 The screen position
Результат Vector2

setViewPos() публичный метод

Center the screen on the given world coordinate
public setViewPos ( Vector2 pos ) : void
pos Vector2 World Coordinate
Результат void

worldToScreen() публичный метод

Returns the screen position matching the given world position
public worldToScreen ( Vector2 pos ) : Vector2
pos Vector2 world position
Результат Vector2

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

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

public Vector2 center
Результат Vector2