C# 클래스 Paint.BaseGame

Base game - derived from the MonoGame Game class and acts as a base class for our separate 'paint' and 'playback' apps
상속: Microsoft.Xna.Framework.Game
파일 보기 프로젝트 열기: RandolphBurt/MonoGame-iOS-SimplePaint

보호된 프로퍼티들

프로퍼티 타입 설명
BackgroundColor Color
Canvas ICanvas
CanvasTouchPoints List
DeviceScale int
GraphicsDeviceManager GraphicsDeviceManager
GraphicsDisplay IGraphicsDisplay
ImageStateData ImageStateData
InMemoryCanvasRenderTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D
InMemoryToolboxRenderTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D
InitialDraw bool
SpriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
ToolBox IToolBox
ToolboxLayoutDefinition Paint.ToolboxLayout.ToolboxLayoutDefinition

공개 메소드들

메소드 설명
BaseGame ( ImageStateData imageStateData, ToolboxLayoutDefinition toolboxLayoutDefinition, int deviceScale ) : System

Initializes a new instance of the Paint.BaseGame class.

보호된 메소드들

메소드 설명
BlankRenderTarget ( RenderTarget2D renderTarget ) : void

Blanks the render target.

CheckToolboxCollision ( ITouchPoint touchPoint ) : bool

Checks whether the user has touched inside the toolbox

ConvertGestureType ( GestureType gestureType ) : TouchType

Converts a MonoGame.GestureType into our TouchType representation

ConvertScreenTouchToCanvasTouch ( TouchPointSizeColour screenTouchPoint ) : TouchPointSizeColour

Converts the screen touchpoint to a canvas touchpoint - i.e. alters the position of the touch to take into account the position and size of the toolbox

CreateRenderTargets ( ) : void

Creates the canvas.

CreateToolbox ( ) : IToolBox

Creates the toolbox.

Draw ( GameTime gameTime ) : void

Called everytime we need to redraw the screen

Initialize ( ) : void

Enable the capturing of gestures on the device

LoadContent ( ) : void

We load any content we need at the beginning of the application life cycle. Also anything that needs initialising is done here

비공개 메소드들

메소드 설명
DrawCanvasOnScreen ( ) : void

Draws the canvas on screen.

DrawToolboxOnScreen ( ) : void

Draws the toolbox on screen.

메소드 상세

BaseGame() 공개 메소드

Initializes a new instance of the Paint.BaseGame class.
public BaseGame ( ImageStateData imageStateData, ToolboxLayoutDefinition toolboxLayoutDefinition, int deviceScale ) : System
imageStateData ImageStateData ImageSaveData
toolboxLayoutDefinition Paint.ToolboxLayout.ToolboxLayoutDefinition Layout of the toolbox
deviceScale int Layout of the toolbox
리턴 System

BlankRenderTarget() 보호된 메소드

Blanks the render target.
protected BlankRenderTarget ( RenderTarget2D renderTarget ) : void
renderTarget Microsoft.Xna.Framework.Graphics.RenderTarget2D /// Render target. ///
리턴 void

CheckToolboxCollision() 보호된 메소드

Checks whether the user has touched inside the toolbox
protected CheckToolboxCollision ( ITouchPoint touchPoint ) : bool
touchPoint ITouchPoint
리턴 bool

ConvertGestureType() 보호된 메소드

Converts a MonoGame.GestureType into our TouchType representation
protected ConvertGestureType ( GestureType gestureType ) : TouchType
gestureType GestureType /// The monogame gesture type. ///
리턴 TouchType

ConvertScreenTouchToCanvasTouch() 보호된 메소드

Converts the screen touchpoint to a canvas touchpoint - i.e. alters the position of the touch to take into account the position and size of the toolbox
protected ConvertScreenTouchToCanvasTouch ( TouchPointSizeColour screenTouchPoint ) : TouchPointSizeColour
screenTouchPoint TouchPointSizeColour
리턴 TouchPointSizeColour

CreateRenderTargets() 보호된 메소드

Creates the canvas.
protected CreateRenderTargets ( ) : void
리턴 void

CreateToolbox() 보호된 추상적인 메소드

Creates the toolbox.
protected abstract CreateToolbox ( ) : IToolBox
리턴 IToolBox

Draw() 보호된 메소드

Called everytime we need to redraw the screen
protected Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime /// Allows you to monitor time passed since last draw ///
리턴 void

Initialize() 보호된 메소드

Enable the capturing of gestures on the device
protected Initialize ( ) : void
리턴 void

LoadContent() 보호된 메소드

We load any content we need at the beginning of the application life cycle. Also anything that needs initialising is done here
protected LoadContent ( ) : void
리턴 void

프로퍼티 상세

BackgroundColor 보호되어 있는 프로퍼티

Background color for our app
protected Color BackgroundColor
리턴 Color

Canvas 보호되어 있는 프로퍼티

Where we draw our picture - the canvas/paper/drawing board
protected ICanvas Canvas
리턴 ICanvas

CanvasTouchPoints 보호되어 있는 프로퍼티

Keeps track of all touch/gestures made on the canvas since the last Draw command- is then reset after handled by the Draw.
protected List CanvasTouchPoints
리턴 List

DeviceScale 보호되어 있는 프로퍼티

The device scale/resolution. 1 = normal. 2 = retina.
protected int DeviceScale
리턴 int

GraphicsDeviceManager 보호되어 있는 프로퍼티

Our monogame GrahicsDeviceManager handles all the rendering
protected GraphicsDeviceManager GraphicsDeviceManager
리턴 GraphicsDeviceManager

GraphicsDisplay 보호되어 있는 프로퍼티

The graphics texture map - contains all our graphics for buttons etc
protected IGraphicsDisplay GraphicsDisplay
리턴 IGraphicsDisplay

ImageStateData 보호되어 있는 프로퍼티

The image state data. height/width of image and details of save points (undo/redo state)
protected ImageStateData,Paint ImageStateData
리턴 ImageStateData

InMemoryCanvasRenderTarget 보호되어 있는 프로퍼티

An in memory render target - as the user draws on the canvas then so we update this rendertarget. Then each 'draw cycle' we render this to the screen.
protected RenderTarget2D,Microsoft.Xna.Framework.Graphics InMemoryCanvasRenderTarget
리턴 Microsoft.Xna.Framework.Graphics.RenderTarget2D

InMemoryToolboxRenderTarget 보호되어 있는 프로퍼티

An in memory render target for holding the toolbox Then each 'draw cycle' we render this to the screen.
protected RenderTarget2D,Microsoft.Xna.Framework.Graphics InMemoryToolboxRenderTarget
리턴 Microsoft.Xna.Framework.Graphics.RenderTarget2D

InitialDraw 보호되어 있는 프로퍼티

Simply tracks whether this is the very first time we are drawing the canvas - if so then we need to draw everything on each control/tool.
protected bool InitialDraw
리턴 bool

SpriteBatch 보호되어 있는 프로퍼티

The sprite batch handles all the drawing to the render targets / screen
protected SpriteBatch,Microsoft.Xna.Framework.Graphics SpriteBatch
리턴 Microsoft.Xna.Framework.Graphics.SpriteBatch

ToolBox 보호되어 있는 프로퍼티

The tool box - contains all our controls/buttons for the user to interact with the app
protected IToolBox ToolBox
리턴 IToolBox

ToolboxLayoutDefinition 보호되어 있는 프로퍼티

Defines the layout of all the controls in the toolbox
protected ToolboxLayoutDefinition,Paint.ToolboxLayout ToolboxLayoutDefinition
리턴 Paint.ToolboxLayout.ToolboxLayoutDefinition