C# Class Nez.Graphics

wrapper class that holds in instance of a Batcher and helpers so that it can be passed around and draw anything.
Exibir arquivo Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
batcher Batcher
bitmapFont BitmapFont
instance Graphics
pixelTexture Nez.Textures.Subtexture

Public Methods

Method Description
Graphics ( ) : System
Graphics ( BitmapFont font ) : System
createSingleColorTexture ( int width, int height, Color color ) : Microsoft.Xna.Framework.Graphics.Texture2D

helper method that generates a single color texture of the given dimensions

unload ( ) : void

Method Details

Graphics() public method

public Graphics ( ) : System
return System

Graphics() public method

public Graphics ( BitmapFont font ) : System
font BitmapFont
return System

createSingleColorTexture() public static method

helper method that generates a single color texture of the given dimensions
public static createSingleColorTexture ( int width, int height, Color color ) : Microsoft.Xna.Framework.Graphics.Texture2D
width int Width.
height int Height.
color Color Color.
return Microsoft.Xna.Framework.Graphics.Texture2D

unload() public method

public unload ( ) : void
return void

Property Details

batcher public_oe property

All 2D rendering is done through this Batcher instance
public Batcher,Nez batcher
return Batcher

bitmapFont public_oe property

default font is loaded up and stored here for easy access. Nez uses it for the DebugConsole
public BitmapFont bitmapFont
return BitmapFont

instance public_oe static_oe property

public static Graphics,Nez instance
return Graphics

pixelTexture public_oe property

A subtexture used to draw rectangles, lines, circles, etc. Will be generated at startup, but you can replace this with a subtexture from your atlas to reduce texture swaps. Should be a 1x1 white pixel
public Subtexture,Nez.Textures pixelTexture
return Nez.Textures.Subtexture