C# Class Paint.GraphicsDisplay

GraphicsDisplay class - defines the rectangles for the different images used in the app
Inheritance: IGraphicsDisplay
Mostrar archivo Open project: RandolphBurt/MonoGame-iOS-SimplePaint

Public Methods

Method Description
BeginRender ( ) : void

Begins the drawing process.

BeginRenderNonPremultiplied ( ) : void

Begins the drawing process - using NonPremultiplied as the color merging option

BeginRenderOpaque ( ) : void

Begins the drawing process - using opaque as the color merging option

DrawGraphic ( ImageType imageType, Rectangle paintRegion, Color color ) : void

Renders a specific image

EndRender ( ) : void

End the current rendering process

GraphicsDisplay ( Microsoft.Xna.Framework.Graphics.Texture2D graphicsTexture, SpriteBatch spriteBatch, bool highResolution ) : System

Initializes a new instance of the Paint.GraphicsDisplay class.

SourceRectangleFromImageType ( ImageType imageType ) : Rectangle

Calculates the area of the texturemap that we need to use for rendering a specific image

Method Details

BeginRender() public method

Begins the drawing process.
public BeginRender ( ) : void
return void

BeginRenderNonPremultiplied() public method

Begins the drawing process - using NonPremultiplied as the color merging option
public BeginRenderNonPremultiplied ( ) : void
return void

BeginRenderOpaque() public method

Begins the drawing process - using opaque as the color merging option
public BeginRenderOpaque ( ) : void
return void

DrawGraphic() public method

Renders a specific image
public DrawGraphic ( ImageType imageType, Rectangle paintRegion, Color color ) : void
imageType ImageType Type of image we want to render
paintRegion Microsoft.Xna.Framework.Rectangle destination rectangle to render the graphic
color Color Colour to use for rendering the image
return void

EndRender() public method

End the current rendering process
public EndRender ( ) : void
return void

GraphicsDisplay() public method

Initializes a new instance of the Paint.GraphicsDisplay class.
public GraphicsDisplay ( Microsoft.Xna.Framework.Graphics.Texture2D graphicsTexture, SpriteBatch spriteBatch, bool highResolution ) : System
graphicsTexture Microsoft.Xna.Framework.Graphics.Texture2D The sprite map - all images we need to render
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Low level rendering class
highResolution bool Is the iPad running in High resolution.
return System

SourceRectangleFromImageType() public method

Calculates the area of the texturemap that we need to use for rendering a specific image
public SourceRectangleFromImageType ( ImageType imageType ) : Rectangle
imageType ImageType Type of image we want to render
return Microsoft.Xna.Framework.Rectangle