C# Class SharpHelper.Sharp2D

Permit to draw font
Inheritance: IDisposable
Mostrar archivo Open project: RobyDX/SharpDX_Demo Class Usage Examples

Public Methods

Method Description
Begin ( ) : void

Begin a 2D drawing session

Dispose ( ) : void

Dispose

DrawString ( string text, int x, int y, int width = 800, int height = 600 ) : void

Draw text

End ( ) : void

End drawing session

SetFont ( Color fontColor, string fontName, int fontSize ) : void

Set font parameters

Private Methods

Method Description
InitFont ( ) : void
Release ( ) : void

Release all resources

Sharp2D ( SharpDevice device ) : System

Create a batch manager for drawing text and sprite

UpdateResources ( SharpDX backBuffer ) : void

Update all resources

Method Details

Begin() public method

Begin a 2D drawing session
public Begin ( ) : void
return void

Dispose() public method

Dispose
public Dispose ( ) : void
return void

DrawString() public method

Draw text
public DrawString ( string text, int x, int y, int width = 800, int height = 600 ) : void
text string Text
x int Left position
y int Top position
width int Max width
height int Max heigh
return void

End() public method

End drawing session
public End ( ) : void
return void

SetFont() public method

Set font parameters
public SetFont ( Color fontColor, string fontName, int fontSize ) : void
fontColor Color Font Color
fontName string Font Name
fontSize int Font Size
return void