C# Class Paint.PaintApp

The main application class just inherits from the monogame:Game class Override a few key methods and away we go...
Inheritance: BaseGame, IRenderTargertHandler
Afficher le fichier Open project: RandolphBurt/MonoGame-iOS-SimplePaint Class Usage Examples

Méthodes publiques

Méthode Description
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).

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
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.

Method Details

CreateRenderTargets() protected méthode

Creates the render targets (including all the undo buffers).
protected CreateRenderTargets ( ) : void
Résultat void

CreateToolbox() protected méthode

Creates the toolbox.
protected CreateToolbox ( ) : IToolBox
Résultat IToolBox

Draw() protected méthode

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 ///
Résultat void

ForceSaveAndExit() public méthode

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
Résultat void

LoadContent() protected méthode

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
Résultat void

PaintApp() public méthode

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.
Résultat System

RestoreSavePoint() public méthode

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
Résultat void

StoreSavePoint() public méthode

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
Résultat void

Update() protected méthode

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 ///
Résultat void