Method |
Description |
|
DrawCenteredString ( SpriteBatch spriteBatch, SpriteFont spriteFont, string text, Vector2 position, Color color ) : void |
|
|
DrawCross ( SpriteBatch spriteBatch, Vector2 center, int size, Color background, float layerDepth ) : void |
|
|
DrawMultiLineString ( SpriteBatch spriteBatch, SpriteFont spriteFont, string text, int pxMaxLineLength, int padding, Vector2 position, Color color ) : void |
This method takes a string and automatically attempts to fit the string within the specified max line length parameter by splitting it into multiple lines when possible. This is done by taking each token in the string that is divided by the whitespace character ' '. It is still possible for one of the lines in the string to exceed the pxMaxLineLength paramater value if a token is longer than the specified amount. A padding value is required to be passed to specify how much pixel space should be used between each line outputted. The Vector2 value passed to the function specifies the center where the string will be drawn to the screen. |
|
DrawRectangle ( this spriteBatch, Rectangle destRectangle, Color background, float layerDepth ) : void |
This can probably be vastly improved using vertices and a shader. The current method is extremely ineffecient for what its intentional purpose is. (TODO) |
|
FillRectangle ( SpriteBatch spriteBatch, Rectangle destRectangle, Color background, float layerDepth ) : void |
|
|