C# Class PathfindingTest.Map.MiniMap

显示文件 Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Public Properties

Property Type Description
game Game1
miniLightTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D
miniMainTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D
miniMapTileSize Vector2

Public Methods

Method Description
CreateMiniMap ( System.Boolean dummy ) : void

Creates a minimap - the new way!

Draw ( SpriteBatch sb, Rectangle targetRectangle ) : void

Draws the minimap on the screen

GetScaledInstance ( Microsoft.Xna.Framework.Graphics.Texture2D originalTexture, Vector2 targetSize ) : Microsoft.Xna.Framework.Graphics.Texture2D

Gets a scaled instance of a texture.

GetScaledInstance ( Microsoft.Xna.Framework.Graphics.Texture2D originalTexture, float factor ) : Microsoft.Xna.Framework.Graphics.Texture2D

Gets a scaled instance of a texture.

MapToMiniMap ( Point mapCoordinates ) : Point

Converts map coordinates to mini map coordinates

MergeTextures ( Microsoft.Xna.Framework.Graphics.Texture2D toMerge ) : Microsoft.Xna.Framework.Graphics.Texture2D

Merges textures together to a big texture.

MiniMap ( GameMap map ) : System
MiniMapToMap ( Point miniMapCoordinates ) : Point

Converts mini map to map coordinates

OnMouseClicked ( MouseEvent e ) : void
OnMouseDrag ( MouseEvent e ) : void

Private Methods

Method Description
ActionOnMiniMap ( Point miniMapLocation ) : void

Perform an action on the given point

DrawScreenRectangle ( SpriteBatch sb ) : void

Draws the screen rectangle

GetScaledInstanceNoRenderTargetChange ( Microsoft.Xna.Framework.Graphics.Texture2D originalTexture, Vector2 targetSize, RenderTarget2D newRenderTarget ) : Microsoft.Xna.Framework.Graphics.Texture2D

Gets a scaled instance of a texture.

ResetRenderTargets ( Microsoft.Xna.Framework.Graphics.RenderTargetBinding oldBindings ) : void
SetRenderTargets ( Microsoft.Xna.Framework.Graphics.RenderTargetBinding &oldBindings, RenderTarget2D &newRenderTarget ) : void

Sets the render target for scaling.

Method Details

CreateMiniMap() public method

Creates a minimap - the new way!
public CreateMiniMap ( System.Boolean dummy ) : void
dummy System.Boolean Just a dummy
return void

Draw() public method

Draws the minimap on the screen
public Draw ( SpriteBatch sb, Rectangle targetRectangle ) : void
sb Microsoft.Xna.Framework.Graphics.SpriteBatch SpriteBatch to draw on.
targetRectangle Microsoft.Xna.Framework.Rectangle The target rectangle the minimap will appear on.
return void

GetScaledInstance() public method

Gets a scaled instance of a texture.
public GetScaledInstance ( Microsoft.Xna.Framework.Graphics.Texture2D originalTexture, Vector2 targetSize ) : Microsoft.Xna.Framework.Graphics.Texture2D
originalTexture Microsoft.Xna.Framework.Graphics.Texture2D The original texture
targetSize Vector2 The vector target size.
return Microsoft.Xna.Framework.Graphics.Texture2D

GetScaledInstance() public method

Gets a scaled instance of a texture.
public GetScaledInstance ( Microsoft.Xna.Framework.Graphics.Texture2D originalTexture, float factor ) : Microsoft.Xna.Framework.Graphics.Texture2D
originalTexture Microsoft.Xna.Framework.Graphics.Texture2D
factor float
return Microsoft.Xna.Framework.Graphics.Texture2D

MapToMiniMap() public method

Converts map coordinates to mini map coordinates
public MapToMiniMap ( Point mapCoordinates ) : Point
mapCoordinates Point The map coordinates you want to convert
return Point

MergeTextures() public method

Merges textures together to a big texture.
public MergeTextures ( Microsoft.Xna.Framework.Graphics.Texture2D toMerge ) : Microsoft.Xna.Framework.Graphics.Texture2D
toMerge Microsoft.Xna.Framework.Graphics.Texture2D The textures to merge, THEY MUST BE THE SAME SIZE.
return Microsoft.Xna.Framework.Graphics.Texture2D

MiniMap() public method

public MiniMap ( GameMap map ) : System
map GameMap
return System

MiniMapToMap() public method

Converts mini map to map coordinates
public MiniMapToMap ( Point miniMapCoordinates ) : Point
miniMapCoordinates Point The mini map coordinates you want to convert
return Point

OnMouseClicked() public method

public OnMouseClicked ( MouseEvent e ) : void
e MouseEvent
return void

OnMouseDrag() public method

public OnMouseDrag ( MouseEvent e ) : void
e MouseEvent
return void

Property Details

game public_oe property

public Game1 game
return Game1

miniLightTarget public_oe property

public RenderTarget2D,Microsoft.Xna.Framework.Graphics miniLightTarget
return Microsoft.Xna.Framework.Graphics.RenderTarget2D

miniMainTarget public_oe property

public RenderTarget2D,Microsoft.Xna.Framework.Graphics miniMainTarget
return Microsoft.Xna.Framework.Graphics.RenderTarget2D

miniMapTileSize public_oe property

public Vector2 miniMapTileSize
return Vector2