Vertices Engine  v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
Loading...
Searching...
No Matches
VerticesEngine.vxGameplaySceneBase Class Reference

This screen implements the actual game logic. It is just a placeholder to get the idea across: you'll probably want to put some more interesting gameplay in here! More...

Inheritance diagram for VerticesEngine.vxGameplaySceneBase:
VerticesEngine.vxBaseScene VerticesEngine.vxGameplayScene2D VerticesEngine.vxGameplayScene2D VerticesEngine.vxGameplayScene3D VerticesEngine.vxGameplayScene3D VerticesEngine.vxGameplayScene3D VerticesEngine.vxGameplayScene3D VerticesEngine.Screens.vxModelViewer VerticesEngine.Screens.vxModelViewer VerticesEngine.Screens.vxModelViewer VerticesEngine.Screens.vxModelViewer

Public Member Functions

 vxGameplaySceneBase (vxStartGameMode sandboxStartGameType=vxStartGameMode.GamePlay, string FilePath="", int NumberOfPlayers=1)
 Initializes a new instance of the T:VerticesEngine.vxSceneBase class.
 
override void LoadContent ()
 Load graphics content for the game.
 
override void UnloadContent ()
 Unload graphics content used by the game.
 
void DebugMethodCall (string method, ConsoleColor ConsoleColor=ConsoleColor.Yellow)
 
GetSubSystem< T > ()
 Get the subsystem of type T
 
bool TryGetSubSystem< T > (out T subSystem)
 Tries to get the subsystem of type T
 
virtual vxFileInfo GetFileInfo ()
 
virtual void SaveFile (bool takeScreenshot, bool DoDump=false)
 Saves the current Sandbox File.
 
virtual vxSaveBusyScreen GetAsyncSaveScreen ()
 Gets the async save screen. Override this to provide a custom save screeen.
 
virtual void SaveSupportFiles ()
 Saves the support files such as as thumbnail and img. Override to add your own files.
 
virtual string GetExporterInfo ()
 This is a Verbose Debug info for which game saved the file.
 
virtual void AddForDisposal (vxEntity entity)
 
virtual vxSerializableSceneBaseData InitSaveFile ()
 Initialises the Save File. If the XML Save file uses a different type, then this can be overridden.
 
virtual vxSerializableSceneBaseData DeserializeFile (string path)
 Returns a Deserializes the File. If you want to use a different type to Serialise than the base 'vxSerializableScene3DData' then you must override this or it will throw an error.
 
virtual void DumpFile ()
 
virtual void PackFile ()
 
void SpawnParticle (object key, vxGameObject emitter)
 Spawns a new particle using the specified key from the Particle System.
 
virtual void SimulationStart ()
 
virtual void SimulationStop ()
 
virtual void ShowPauseScreen ()
 This Method Loads the Engine Base Pause Screen (PauseMenuScreen()), but more items might be needed to be added. Override to load your own Pause Screen.
 
virtual void DrawBackground ()
 Draw's the background before proceeding with other drawing. This is useful for Skyboxes and backgrounds as a whole.
 
override void Draw ()
 Draws the gameplay screen.
 
virtual void DrawScene ()
 Draws the scene.
 
- Public Member Functions inherited from VerticesEngine.vxBaseScene
virtual System.Collections.IEnumerator LoadContentAsync ()
 Loads content as part of a Coroutine allowing the game to update frames during the loading process.
 
virtual bool PlaySound (vxBaseScene sender, SoundEffect SoundEffect, float Volume=1, float Pitch=0)
 
void ExitScreen ()
 Tells the screen to go away. Unlike ScreenManager.RemoveScreen, which instantly kills the screen, this method respects the transition timings and will give the screen a chance to gradually transition off.
 
virtual void Dispose ()
 

Public Attributes

List< vxUtilCamera3DUtilCameras = new List<vxUtilCamera3D>()
 
ContentManager SceneContent
 The content manager for this scene. This is unloaded at the end of the scene.
 
vxNetworkGameType NetGameType = vxNetworkGameType.Local
 The type of the game, whether its a Local game or Networked.
 
bool IsStartBackground = false
 Is this level the start background.
 
bool IsGUIVisible = true
 Should the GUI be shown?
 
bool IsSceneDimmedOnCover = true
 Whether or not to dim the scene when it's covered by another screen.
 
readonly int NumberOfPlayers
 The number of players in this Scene. This must be set in the constructor.
 
float PauseAlpha
 This is the Pause Alpha Amount based off of the poisition the screen is in terms of transitioning too a new screen.
 
bool IsPausable = true
 Gets or sets a value indicating whether this instance is pausable.
 
vxViewportManager ViewportManager
 The viewport manager.
 
bool IsDumping = false
 
vxSerializableSceneBaseData SandBoxFile
 File Format.
 
Texture2D ThumbnailImage
 A thumbnail of the latest run.
 
string FilePath = ""
 
string FileName = "sandboxFile1"
 
vxOpenSandboxFileDialog OpenFileDialog
 An in game Open File Dialog too access files from specific directories.
 
Color BackBufferClearColor = Color.DarkMagenta
 The color to clear the back buffer with.
 
bool IsUIVisibilitySuppressed = false
 Is the UI Visibility suppressed. This is useful for certain cases in Screen shots.
 

Static Public Attributes

const string IMG_PREVIEW_FILE_NAME = "preview.jpg"
 
const string IMG_THUMBNAIL_FILE_NAME = "thumbnail.png"
 

Protected Member Functions

virtual void InitialisePhysics ()
 Initialises the physics engine for this scene.
 
virtual void InitialiseCameras ()
 Initialises the cameras for this scene.
 
virtual void OnInitialiseGUI ()
 
virtual void InitialiseViewportManager ()
 Initialises the Viewport Manager.
 
virtual void RegisterSandboxEntities ()
 
virtual void SetupObjectPools ()
 
virtual void UnloadObjectPools ()
 
virtual void InitialiseSubSystems ()
 Initialise your scenes subsystems here.
 
virtual void LoadParticlePools ()
 
virtual T AddSystem< T > ()
 Add a subsystem of type vxISceneSubSystem. It must be scene subsystem.
 
virtual vxSandboxFileLoadResult LoadFile (string FilePath)
 
virtual void OnFileInfoLoad (vxFileInfo fileInfo)
 When File Info is Loaded. This is called before LoadFile(...) is called.
 
virtual vxSandboxFileLoadResult LoadXMLFile (string FilePath, int version)
 
virtual Point GetPreviewImageSize ()
 
virtual Point GetThumbnailImageSize ()
 
virtual void OnLevelEditorNewFileToolbarItemClicked (object sender, vxUIControlClickEventArgs e)
 Start a New File.
 
virtual void OnLevelEditorNewFilePromptAccepted (object sender, PlayerIndexEventArgs e)
 When to do when the New File button is clicked. This must be overridden.
 
virtual vxGameplaySceneBase OnNewSandbox ()
 Called when a New Sandbox file is called. Override this to provide your base class.
 
virtual void OnLevelEditorOpenFileToolbarItemClicked (object sender, vxUIControlClickEventArgs e)
 Event for Opening a File.
 
virtual void OnLevelEditorOpenFileDialogPromptAccepted (vxFileDialogItem file)
 
virtual vxGameplaySceneBase OnOpenSandboxFile (string filePath)
 Called when a New Sandbox file is called. Override this to provide your base class.
 
virtual void OnLevelEditorSaveBeforeCloseCheck_Accepted (object sender, PlayerIndexEventArgs e)
 
virtual void OnLevelEditorSaveBeforeCloseCheck_DontSave (object sender, PlayerIndexEventArgs e)
 
virtual void SaveFileAs (string saveAsMsg="Save the current file as...")
 
virtual void OnLevelEditorSaveFileToolbarItemClicked (object sender, vxUIControlClickEventArgs e)
 Event for Saving the Current File.
 
virtual void OnLevelEditorSaveAsFileToolbarItemClicked (object sender, vxUIControlClickEventArgs e)
 Event for Saving As the Current File.
 
virtual void HandleInputBase ()
 Handles the input base.
 
- Protected Member Functions inherited from VerticesEngine.vxBaseScene
virtual void OnFirstUpdate ()
 Called at the start of this scenes first update/tick.
 
virtual void OnFirstDraw ()
 Called on the first draw of this scene.
 

Protected Attributes

bool IsSandbox = true
 Is this a sandbox scene, if so then we will load any and all registered types. Otherwise you'll.
 
Dictionary< string, Type > TypeRegister = new Dictionary<string, Type>()
 
List< vxEntityDisposalQueue = new List<vxEntity>()
 
- Protected Attributes inherited from VerticesEngine.vxBaseScene
bool IsLoadingTimeMeasured = false
 
bool HideIfCovered = true
 

Properties

List< vxCameraCameras [get]
 The cameras collection.
 
vxParticleSystemManager ParticleSystem [get]
 The particle system.
 
vxIPlayerProfile PlayerProfile [get]
 
vxUIManager UIManager [get]
 The Scene UI Manager.
 
string Title [get, set]
 The Level Title.
 
string Description [get, set]
 The Level Description.
 
string WorkshopID [get, set]
 
Texture2D DefaultTexture [get]
 Gets the default texture.
 
vxCommandManager CommandManager [get]
 The command manager to handle undo redos.
 
List< vxEntityEntities [get]
 The entity collection for this Scene.
 
List< vxEntity3DEditorEntities [get]
 Editor Entities.
 
vxEnumSandboxStatus SandboxCurrentState [get, set]
 Is the Sandbox In Testing Mode.
 
vxStartGameMode SandboxStartGameType [get, set]
 
virtual bool IsSandboxLevelContentFile [get]
 Is the sandbox level a content file or external/DLC?
 
Texture2D PreviewImage [get, set]
 The preview image used for this level.
 
bool IsNewSandboxFile [get]
 Returns back whether this is a new sandbox file.
 
- Properties inherited from VerticesEngine.vxBaseScene
bool IsPopup [get, protected set]
 Normally when one screen is brought up over the top of another, the first screen will transition off to make room for the new one. This property indicates whether the screen is only a small popup, in which case screens underneath it do not need to bother transitioning off.
 
bool IsRemoved [get, set]
 Has this scene been removed?
 
TimeSpan TransitionOnTime [get, protected set]
 Indicates how long the screen takes to transition on when it is activated.
 
TimeSpan TransitionOffTime [get, protected set]
 Indicates how long the screen takes to transition off when it is deactivated.
 
float TransitionPosition [get, protected set]
 Gets the current position of the screen transition, ranging from zero (fully active, no transition) to one (transitioned fully off to nothing).
 
float TransitionAlpha [get]
 Gets the current alpha of the screen transition, ranging from 1 (fully active, no transition) to 0 (transitioned fully off to nothing).
 
ScreenState ScreenState [get, protected set]
 Gets the current screen transition state.
 
bool IsExiting [get, set]
 There are two possible reasons why a screen might be transitioning off. It could be temporarily going away to make room for another screen that is on top of it, or it could be going away for good. This property indicates whether the screen is exiting for real: if set, the screen will automatically remove itself as soon as the transition finishes.
 
bool IsActive [get]
 Checks whether this screen is active and can respond to user input.
 
bool otherScreenHasFocus [get, set]
 
bool IsFirstLoop [get]
 Gets a value indicating whether this T:VerticesEngine.vxGameBaseScreen is first loop.
 
bool IsLoadingFile [get, set]
 Returns whether we're currently loading a file or not.
 
PlayerIndex? ControllingPlayer [get, set]
 Gets the index of the player who is currently controlling this screen, or null if it is accepting input from any player. This is used to lock the game to a specific player profile. The main menu responds to input from any connected gamepad, but whichever player makes a selection from this menu is given control over all subsequent screens, so other gamepads are inactive until the controlling player returns to the main menu.
 
bool IsContentLoaded [get, set]
 Has all the content been loaded yet?
 
bool coveredByOtherScreen [get, set]
 

Detailed Description

This screen implements the actual game logic. It is just a placeholder to get the idea across: you'll probably want to put some more interesting gameplay in here!

Constructor & Destructor Documentation

◆ vxGameplaySceneBase()

VerticesEngine.vxGameplaySceneBase.vxGameplaySceneBase ( vxStartGameMode sandboxStartGameType = vxStartGameMode::GamePlay,
string FilePath = "",
int NumberOfPlayers = 1 )

Initializes a new instance of the T:VerticesEngine.vxSceneBase class.

Parameters
sandboxStartGameTypeSandbox start game type.
FilePathFile path.
NumberOfPlayersNumber of players.

Member Function Documentation

◆ AddSystem< T >()

virtual T VerticesEngine.vxGameplaySceneBase.AddSystem< T > ( )
protectedvirtual

Add a subsystem of type vxISceneSubSystem. It must be scene subsystem.

Template Parameters
T
Returns
Exceptions
Exception
Type Constraints
T :vxISceneSubSystem 

◆ DeserializeFile()

virtual vxSerializableSceneBaseData VerticesEngine.vxGameplaySceneBase.DeserializeFile ( string path)
virtual

Returns a Deserializes the File. If you want to use a different type to Serialise than the base 'vxSerializableScene3DData' then you must override this or it will throw an error.

Reimplemented in VerticesEngine.vxGameplayScene3D.

◆ Draw()

override void VerticesEngine.vxGameplaySceneBase.Draw ( )
virtual

Draws the gameplay screen.

Reimplemented from VerticesEngine.vxBaseScene.

◆ DrawScene()

virtual void VerticesEngine.vxGameplaySceneBase.DrawScene ( )
virtual

Draws the scene.

Parameters
gameTimeGame time.

Reimplemented in VerticesEngine.vxGameplayScene2D, and VerticesEngine.Screens.vxModelViewer.

◆ GetAsyncSaveScreen()

virtual vxSaveBusyScreen VerticesEngine.vxGameplaySceneBase.GetAsyncSaveScreen ( )
virtual

Gets the async save screen. Override this to provide a custom save screeen.

Returns
The async save screen.

Reimplemented in VerticesEngine.vxGameplayScene2D, and VerticesEngine.vxGameplayScene3D.

◆ GetExporterInfo()

virtual string VerticesEngine.vxGameplaySceneBase.GetExporterInfo ( )
virtual

This is a Verbose Debug info for which game saved the file.

Returns

◆ GetSubSystem< T >()

T VerticesEngine.vxGameplaySceneBase.GetSubSystem< T > ( )

Get the subsystem of type T

Template Parameters
T
Returns
Type Constraints
T :vxISubSystem 

◆ HandleInputBase()

virtual void VerticesEngine.vxGameplaySceneBase.HandleInputBase ( )
protectedvirtual

Handles the input base.

Parameters
inputInput.

Reimplemented in VerticesEngine.vxGameplayScene2D, and VerticesEngine.vxGameplayScene3D.

◆ InitialiseCameras()

virtual void VerticesEngine.vxGameplaySceneBase.InitialiseCameras ( )
protectedvirtual

Initialises the cameras for this scene.

Reimplemented in VerticesEngine.vxGameplayScene2D, and VerticesEngine.vxGameplayScene3D.

◆ InitialisePhysics()

virtual void VerticesEngine.vxGameplaySceneBase.InitialisePhysics ( )
protectedvirtual

Initialises the physics engine for this scene.

Reimplemented in VerticesEngine.vxGameplayScene2D, and VerticesEngine.vxGameplayScene3D.

◆ InitialiseSubSystems()

virtual void VerticesEngine.vxGameplaySceneBase.InitialiseSubSystems ( )
protectedvirtual

Initialise your scenes subsystems here.

Reimplemented in VerticesEngine.vxGameplayScene3D.

◆ InitSaveFile()

virtual vxSerializableSceneBaseData VerticesEngine.vxGameplaySceneBase.InitSaveFile ( )
virtual

Initialises the Save File. If the XML Save file uses a different type, then this can be overridden.

Returns

Reimplemented in VerticesEngine.vxGameplayScene3D.

◆ LoadContent()

override void VerticesEngine.vxGameplaySceneBase.LoadContent ( )
virtual

Load graphics content for the game.

Reimplemented from VerticesEngine.vxBaseScene.

Reimplemented in VerticesEngine.Screens.vxModelViewer.

◆ OnFileInfoLoad()

virtual void VerticesEngine.vxGameplaySceneBase.OnFileInfoLoad ( vxFileInfo fileInfo)
protectedvirtual

When File Info is Loaded. This is called before LoadFile(...) is called.

Parameters
fileInfoFile info.

◆ OnInitialiseGUI()

virtual void VerticesEngine.vxGameplaySceneBase.OnInitialiseGUI ( )
protectedvirtual

◆ OnLevelEditorNewFilePromptAccepted()

virtual void VerticesEngine.vxGameplaySceneBase.OnLevelEditorNewFilePromptAccepted ( object sender,
PlayerIndexEventArgs e )
protectedvirtual

When to do when the New File button is clicked. This must be overridden.

Parameters
sender
e

◆ OnLevelEditorNewFileToolbarItemClicked()

virtual void VerticesEngine.vxGameplaySceneBase.OnLevelEditorNewFileToolbarItemClicked ( object sender,
vxUIControlClickEventArgs e )
protectedvirtual

Start a New File.

Parameters
sender
e

◆ OnLevelEditorOpenFileToolbarItemClicked()

virtual void VerticesEngine.vxGameplaySceneBase.OnLevelEditorOpenFileToolbarItemClicked ( object sender,
vxUIControlClickEventArgs e )
protectedvirtual

Event for Opening a File.

Parameters
sender
e

◆ OnLevelEditorSaveAsFileToolbarItemClicked()

virtual void VerticesEngine.vxGameplaySceneBase.OnLevelEditorSaveAsFileToolbarItemClicked ( object sender,
vxUIControlClickEventArgs e )
protectedvirtual

Event for Saving As the Current File.

Parameters
sender
e

◆ OnLevelEditorSaveFileToolbarItemClicked()

virtual void VerticesEngine.vxGameplaySceneBase.OnLevelEditorSaveFileToolbarItemClicked ( object sender,
vxUIControlClickEventArgs e )
protectedvirtual

Event for Saving the Current File.

Parameters
sender
e

◆ OnNewSandbox()

virtual vxGameplaySceneBase VerticesEngine.vxGameplaySceneBase.OnNewSandbox ( )
protectedvirtual

Called when a New Sandbox file is called. Override this to provide your base class.

Returns
The new sandbox.

Reimplemented in VerticesEngine.vxGameplayScene3D.

◆ OnOpenSandboxFile()

virtual vxGameplaySceneBase VerticesEngine.vxGameplaySceneBase.OnOpenSandboxFile ( string filePath)
protectedvirtual

Called when a New Sandbox file is called. Override this to provide your base class.

Returns
The new sandbox.

◆ RegisterSandboxEntities()

virtual void VerticesEngine.vxGameplaySceneBase.RegisterSandboxEntities ( )
protectedvirtual

◆ SaveFile()

virtual void VerticesEngine.vxGameplaySceneBase.SaveFile ( bool takeScreenshot,
bool DoDump = false )
virtual

Saves the current Sandbox File.

Parameters
takeScreenshot

◆ ShowPauseScreen()

virtual void VerticesEngine.vxGameplaySceneBase.ShowPauseScreen ( )
virtual

This Method Loads the Engine Base Pause Screen (PauseMenuScreen()), but more items might be needed to be added. Override to load your own Pause Screen.

This sample shows how to override the ShowPauseScreen method. 'MyGamesCustomPauseScreen()' inheirts from the VerticesEngine.UI.Menus.vxMenuBaseScreen Class.

//This Allows to show your own custom pause screen.
public override void ShowPauseScreen()
{
vxSceneManager.AddScreen(new MyGamesCustomPauseScreen(), ControllingPlayer);
}
The Scene Manager which handles Scene Loading and drawing.
Definition vxSceneManager.cs:15

Reimplemented in VerticesEngine.vxGameplayScene3D.

◆ SimulationStart()

virtual void VerticesEngine.vxGameplaySceneBase.SimulationStart ( )
virtual

◆ SimulationStop()

virtual void VerticesEngine.vxGameplaySceneBase.SimulationStop ( )
virtual

◆ SpawnParticle()

void VerticesEngine.vxGameplaySceneBase.SpawnParticle ( object key,
vxGameObject emitter )

Spawns a new particle using the specified key from the Particle System.

Parameters
key
emitter

◆ TryGetSubSystem< T >()

bool VerticesEngine.vxGameplaySceneBase.TryGetSubSystem< T > ( out T subSystem)

Tries to get the subsystem of type T

Template Parameters
T
Parameters
subSystem
Returns
Type Constraints
T :vxISubSystem 

◆ UnloadContent()

override void VerticesEngine.vxGameplaySceneBase.UnloadContent ( )
virtual

Unload graphics content used by the game.

Reimplemented from VerticesEngine.vxBaseScene.

Reimplemented in VerticesEngine.Screens.vxModelViewer.

Member Data Documentation

◆ IsPausable

bool VerticesEngine.vxGameplaySceneBase.IsPausable = true

Gets or sets a value indicating whether this instance is pausable.

true if this instance is pausable; otherwise, false.

Property Documentation

◆ DefaultTexture

Texture2D VerticesEngine.vxGameplaySceneBase.DefaultTexture
get

Gets the default texture.

The default texture.


The documentation for this class was generated from the following file: