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

The vxGameplayScene2D class implements the actual game logic for 2D Games. More...

Inheritance diagram for VerticesEngine.vxGameplayScene2D:
VerticesEngine.vxGameplaySceneBase VerticesEngine.vxGameplaySceneBase VerticesEngine.vxBaseScene VerticesEngine.vxBaseScene

Public Member Functions

 vxGameplayScene2D (vxStartGameMode startGameAsType=vxStartGameMode.GamePlay, string FilePath="")
 Initializes a new instance of the T:VerticesEngine.vxScene2D class.
 
override vxSaveBusyScreen GetAsyncSaveScreen ()
 Gets the async save screen. Override this to provide a custom save screeen.
 
virtual void LoadNextLevel ()
 Loads the next level.
 
virtual void ReloadCurrentLevel ()
 Reloads the current level.
 
virtual vxEntity2D AddNewItem (string key)
 Adds a new item with the defualt position.
 
virtual vxEntity2D AddNewItem (string key, Vector2 AddLocation)
 Adds a new item with the add location position. NOTE: (Position is specified in Camera View Space (origin at screen (width/2, height/2), not Screen (origin at screen (0,0)) or Farseer Simulation Space (position is offset by a factor)).
 
override void DrawScene ()
 Draws the scene.
 
virtual void DrawShadowedString (SpriteFont font, string value, Vector2 position, Color color)
 Draws the shadowed string.
 
- Public Member Functions inherited from VerticesEngine.vxGameplaySceneBase
 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 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.
 
- 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< vxDistortionEntity2DDistortionEntities = new List<vxDistortionEntity2D>()
 The distortion entities.
 
World PhysicsSimulation
 Physics World Space.
 
bool AllowCameraInput = true
 The allow camera input.
 
bool AddItem = true
 Should an Item Be Added.
 
- Public Attributes inherited from VerticesEngine.vxGameplaySceneBase
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

static Vector2 DefaultGravity = Vector2.UnitY * 9.81f
 The gravity vector for the Physics Simulation. Note this is set at start time of this class, but can be changed afterwards.
 
static float DisplayToSimUnitRatio = 32
 The display to sim unit ratio for Farseer.
 
- Static Public Attributes inherited from VerticesEngine.vxGameplaySceneBase
const string IMG_PREVIEW_FILE_NAME = "preview.jpg"
 
const string IMG_THUMBNAIL_FILE_NAME = "thumbnail.png"
 

Protected Member Functions

override void InitialisePhysics ()
 Initialises the level.
 
override void InitialiseCameras ()
 Initialises the cameras for this scene.
 
override void LoadParticlePools ()
 
override void HandleInputBase ()
 Handles the input base.
 
virtual vxEntity2D Instaniate (Type type, Vector2 position)
 
- Protected Member Functions inherited from VerticesEngine.vxGameplaySceneBase
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 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.
 
- 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

vxFarseerDebugView DebugView
 The debug view.
 
- Protected Attributes inherited from VerticesEngine.vxGameplaySceneBase
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
 

Additional Inherited Members

- Properties inherited from VerticesEngine.vxGameplaySceneBase
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

The vxGameplayScene2D class implements the actual game logic for 2D Games.

This is the main type for your game.

Member Function Documentation

◆ AddNewItem() [1/2]

virtual vxEntity2D VerticesEngine.vxGameplayScene2D.AddNewItem ( string key)
virtual

Adds a new item with the defualt position.

Returns
The new item.
Parameters
keyKey.

◆ AddNewItem() [2/2]

virtual vxEntity2D VerticesEngine.vxGameplayScene2D.AddNewItem ( string key,
Vector2 AddLocation )
virtual

Adds a new item with the add location position. NOTE: (Position is specified in Camera View Space (origin at screen (width/2, height/2), not Screen (origin at screen (0,0)) or Farseer Simulation Space (position is offset by a factor)).

Returns
The new item.
Parameters
keyKey.
AddLocationPosition to Add Item (Position must be given in Camera View Space).

◆ DrawScene()

override void VerticesEngine.vxGameplayScene2D.DrawScene ( )
virtual

Draws the scene.

Parameters
gameTimeGame time.

Reimplemented from VerticesEngine.vxGameplaySceneBase.

◆ DrawShadowedString()

virtual void VerticesEngine.vxGameplayScene2D.DrawShadowedString ( SpriteFont font,
string value,
Vector2 position,
Color color )
virtual

Draws the shadowed string.

Parameters
fontFont.
valueValue.
positionThis Items Start Position. Note that the 'OriginalPosition' variable will be set to this value as well.
colorColor.

◆ GetAsyncSaveScreen()

override vxSaveBusyScreen VerticesEngine.vxGameplayScene2D.GetAsyncSaveScreen ( )
virtual

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

Returns
The async save screen.

Reimplemented from VerticesEngine.vxGameplaySceneBase.

◆ HandleInputBase()

override void VerticesEngine.vxGameplayScene2D.HandleInputBase ( )
protectedvirtual

Handles the input base.

Parameters
inputInput.

Reimplemented from VerticesEngine.vxGameplaySceneBase.

◆ InitialiseCameras()

override void VerticesEngine.vxGameplayScene2D.InitialiseCameras ( )
protectedvirtual

Initialises the cameras for this scene.

Reimplemented from VerticesEngine.vxGameplaySceneBase.

◆ InitialisePhysics()

override void VerticesEngine.vxGameplayScene2D.InitialisePhysics ( )
protectedvirtual

Initialises the level.

Reimplemented from VerticesEngine.vxGameplaySceneBase.

◆ LoadParticlePools()

override void VerticesEngine.vxGameplayScene2D.LoadParticlePools ( )
protectedvirtual

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