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
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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