C# 클래스 Paint.PaintApp

The main application class just inherits from the monogame:Game class Override a few key methods and away we go...
상속: BaseGame, IRenderTargertHandler
파일 보기 프로젝트 열기: RandolphBurt/MonoGame-iOS-SimplePaint 1 사용 예제들

공개 메소드들

메소드 설명
ForceSaveAndExit ( ) : void

Forces the immediate Shutdown and saving of state on this thread We must not change thread because we are probably going into the background and therefore the main UI thread will not come alive again until the app is back in teh foreground again

PaintApp ( IPictureIOManager pictureIOManager, IFilenameResolver filenameResolver, ImageStateData imageStateData, IUIBusyMessage saveBusyMessageDisplay, ToolboxLayoutDefinition toolboxLayoutDefinition, int deviceScale ) : System

Initializes a new instance of the Paint.PaintApp class. Instantiate our GraphicsDeviceManager and establish where the content folder is

RestoreSavePoint ( int savePoint ) : void

Restore the image held in the specified save point to the canvas/display

StoreSavePoint ( int savePoint ) : void

Save the canvas/display to the specified save-point (undo/redo render target).

보호된 메소드들

메소드 설명
CreateRenderTargets ( ) : void

Creates the render targets (including all the undo buffers).

CreateToolbox ( ) : IToolBox

Creates the toolbox.

Draw ( GameTime gameTime ) : void

Called everytime we need to redraw the screen

LoadContent ( ) : void

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

Update ( GameTime gameTime ) : void

Called often. Allows us to handle any user input (gestures on screen) and/or game time related work - e.g. moving an animation character based on elapsed time since last called etc

비공개 메소드들

메소드 설명
CreatePictureStateManager ( ) : void

Creates the picture state manager.

HandleInput ( ) : void

Handles any user input. Collect all gestures made since the last 'update' - stores these ready to be handled by the Canvas for drawing

InitiateShutdown ( ) : void

Initiates the shutdown process. We will display a 'busy' form/window -- we pass in a delegate/action to be run once the form has displayed

RenderImage ( RenderTarget2D target, RenderTarget2D source ) : void

Renders a specific source RenderTarget on to a specific target RenderTarget

SaveAndExit ( ) : void

Saves all the data and then exits.

메소드 상세

CreateRenderTargets() 보호된 메소드

Creates the render targets (including all the undo buffers).
protected CreateRenderTargets ( ) : void
리턴 void

CreateToolbox() 보호된 메소드

Creates the toolbox.
protected 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

ForceSaveAndExit() 공개 메소드

Forces the immediate Shutdown and saving of state on this thread We must not change thread because we are probably going into the background and therefore the main UI thread will not come alive again until the app is back in teh foreground again
public ForceSaveAndExit ( ) : 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

PaintApp() 공개 메소드

Initializes a new instance of the Paint.PaintApp class. Instantiate our GraphicsDeviceManager and establish where the content folder is
public PaintApp ( IPictureIOManager pictureIOManager, IFilenameResolver filenameResolver, ImageStateData imageStateData, IUIBusyMessage saveBusyMessageDisplay, ToolboxLayoutDefinition toolboxLayoutDefinition, int deviceScale ) : System
pictureIOManager IPictureIOManager Picture IO Manager
filenameResolver IFilenameResolver Filename Resolver
imageStateData ImageStateData ImageSaveData
saveBusyMessageDisplay IUIBusyMessage Class for dsplaying the 'Busy - saving' message
toolboxLayoutDefinition Paint.ToolboxLayout.ToolboxLayoutDefinition Layout of the toolbox
deviceScale int The device scale/resolution. 1 = normal. 2 = retina.
리턴 System

RestoreSavePoint() 공개 메소드

Restore the image held in the specified save point to the canvas/display
public RestoreSavePoint ( int savePoint ) : void
savePoint int specific save point we wish to restore
리턴 void

StoreSavePoint() 공개 메소드

Save the canvas/display to the specified save-point (undo/redo render target).
public StoreSavePoint ( int savePoint ) : void
savePoint int specific save point we wish to use to store the canvas
리턴 void

Update() 보호된 메소드

Called often. Allows us to handle any user input (gestures on screen) and/or game time related work - e.g. moving an animation character based on elapsed time since last called etc
protected Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime /// Allows you to monitor time passed since last draw ///
리턴 void