C# Class Paint.ToolBoxToolTouchBase

Base (Abstract) class for any tools that allow user interaction.
Inheritance: IToolBoxToolTouch
Show file Open project: RandolphBurt/MonoGame-iOS-SimplePaint

Protected Properties

Property Type Description
BackgroundColor Microsoft.Xna.Framework.Color
BorderColor Microsoft.Xna.Framework.Color
BorderWidth int

Public Methods

Method Description
CheckTouchCollision ( ITouchPoint touch ) : bool

Checks wheter a particular touch point (user pressing the screen) is within the bounds of this control.

Draw ( bool refreshDisplay ) : void

Draw this tool on to the image

ToolBoxToolTouchBase ( Microsoft.Xna.Framework.Color backgroundColor, Microsoft.Xna.Framework.Color borderColor, int borderWidth, IGraphicsDisplay graphicsDisplay, Rectangle bounds ) : Microsoft.Xna.Framework

Initializes a new instance of the Paint.CanvasToolTouchBase class.

ToolBoxToolTouchBase ( Microsoft.Xna.Framework.Color backgroundColor, IGraphicsDisplay graphicsDisplay, Rectangle bounds ) : Microsoft.Xna.Framework

Initializes a new instance of the Paint.CanvasToolTouchBase class.

Protected Methods

Method Description
Blank ( ) : void

Blanks the entire control

BlankAndRedrawWithBorder ( ) : void

Blanks this tool and then redraws the border round the edge.

BlankAndRedrawWithBorder ( Rectangle redrawRectangle ) : void

Blanks the specific rectangle and then redraws the border round the edge.

DrawGraphic ( ImageType imageType, Rectangle paintRegion ) : void

Draws the graphic.

DrawRectangle ( Rectangle paintRegion, Microsoft.Xna.Framework.Color color ) : void

Draws the rectangle.

HandleTouch ( ITouchPoint touchPosition ) : void

Handles a particular touch by the user

Method Details

Blank() protected method

Blanks the entire control
protected Blank ( ) : void
return void

BlankAndRedrawWithBorder() protected method

Blanks this tool and then redraws the border round the edge.
protected BlankAndRedrawWithBorder ( ) : void
return void

BlankAndRedrawWithBorder() protected method

Blanks the specific rectangle and then redraws the border round the edge.
protected BlankAndRedrawWithBorder ( Rectangle redrawRectangle ) : void
redrawRectangle Microsoft.Xna.Framework.Rectangle
return void

CheckTouchCollision() public method

Checks wheter a particular touch point (user pressing the screen) is within the bounds of this control.
public CheckTouchCollision ( ITouchPoint touch ) : bool
touch ITouchPoint
return bool

Draw() public abstract method

Draw this tool on to the image
public abstract Draw ( bool refreshDisplay ) : void
refreshDisplay bool /// True = we should redraw the entire control /// False = just draw any updates ///
return void

DrawGraphic() protected method

Draws the graphic.
protected DrawGraphic ( ImageType imageType, Rectangle paintRegion ) : void
imageType ImageType
paintRegion Microsoft.Xna.Framework.Rectangle
return void

DrawRectangle() protected method

Draws the rectangle.
protected DrawRectangle ( Rectangle paintRegion, Microsoft.Xna.Framework.Color color ) : void
paintRegion Microsoft.Xna.Framework.Rectangle
color Microsoft.Xna.Framework.Color
return void

HandleTouch() protected abstract method

Handles a particular touch by the user
protected abstract HandleTouch ( ITouchPoint touchPosition ) : void
touchPosition ITouchPoint
return void

ToolBoxToolTouchBase() public method

Initializes a new instance of the Paint.CanvasToolTouchBase class.
public ToolBoxToolTouchBase ( Microsoft.Xna.Framework.Color backgroundColor, Microsoft.Xna.Framework.Color borderColor, int borderWidth, IGraphicsDisplay graphicsDisplay, Rectangle bounds ) : Microsoft.Xna.Framework
backgroundColor Microsoft.Xna.Framework.Color
borderColor Microsoft.Xna.Framework.Color
borderWidth int
graphicsDisplay IGraphicsDisplay
bounds Microsoft.Xna.Framework.Rectangle
return Microsoft.Xna.Framework

ToolBoxToolTouchBase() public method

Initializes a new instance of the Paint.CanvasToolTouchBase class.
public ToolBoxToolTouchBase ( Microsoft.Xna.Framework.Color backgroundColor, IGraphicsDisplay graphicsDisplay, Rectangle bounds ) : Microsoft.Xna.Framework
backgroundColor Microsoft.Xna.Framework.Color
graphicsDisplay IGraphicsDisplay
bounds Microsoft.Xna.Framework.Rectangle
return Microsoft.Xna.Framework

Property Details

BackgroundColor protected property

The background color of the tool
protected Color,Microsoft.Xna.Framework BackgroundColor
return Microsoft.Xna.Framework.Color

BorderColor protected property

The color of the borders around the control.
protected Color,Microsoft.Xna.Framework BorderColor
return Microsoft.Xna.Framework.Color

BorderWidth protected property

Border size for drawing the tool on screen.
protected int BorderWidth
return int