Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Resources Class Reference

Resource loading. More...

Public Member Functions

integer LoadSprite (string filename, integer unloadPolicy)
 Loads a Sprite resource, returning its Sprite index.
integer LoadDynamicSprite (string fallbackFolder, string name, integer unloadPolicy)
 Loads a Sprite resource via the current Scene's resource folder (else a fallback folder) if a scene list is loaded.
integer LoadImage (string filename, integer unloadPolicy)
 Loads an Image resource, returning its Image index.
integer LoadModel (string filename, integer unloadPolicy)
 Loads Model resource, returning its Model index.
integer LoadMusic (string filename, integer unloadPolicy)
 Loads a Music resource, returning its Music index.
integer LoadSound (string filename, integer unloadPolicy)
 Loads a Sound resource, returning its Sound index.
integer LoadVideo (string filename, integer unloadPolicy)
 Loads a Video resource, returning its Video index.
boolean FileExists (string filename)
 Checks to see if a Resource exists with the given filename.
string ReadAllText (string path)
 Reads all text from the given filename.

Detailed Description

Resource loading.

Member Function Documentation

◆ FileExists()

boolean Resources.FileExists ( string filename)

Checks to see if a Resource exists with the given filename.

Parameters
filenameThe given filename.
Returns
Returns whether the Resource exists.

◆ LoadDynamicSprite()

integer Resources.LoadDynamicSprite ( string fallbackFolder,
string name,
integer unloadPolicy )

Loads a Sprite resource via the current Scene's resource folder (else a fallback folder) if a scene list is loaded.

Parameters
fallbackFolderFolder to check if the sprite does not exist in the current Scene's resource folder.
nameName of the animation file within the resource folder.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ LoadImage()

integer Resources.LoadImage ( string filename,
integer unloadPolicy )

Loads an Image resource, returning its Image index.

Parameters
filenameFilename of the resource.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ LoadModel()

integer Resources.LoadModel ( string filename,
integer unloadPolicy )

Loads Model resource, returning its Model index.

Parameters
filenameFilename of the resource.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ LoadMusic()

integer Resources.LoadMusic ( string filename,
integer unloadPolicy )

Loads a Music resource, returning its Music index.

Parameters
filenameFilename of the resource.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ LoadSound()

integer Resources.LoadSound ( string filename,
integer unloadPolicy )

Loads a Sound resource, returning its Sound index.

Parameters
filenameFilename of the resource.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ LoadSprite()

integer Resources.LoadSprite ( string filename,
integer unloadPolicy )

Loads a Sprite resource, returning its Sprite index.

Parameters
filenameFilename of the resource.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ LoadVideo()

integer Resources.LoadVideo ( string filename,
integer unloadPolicy )

Loads a Video resource, returning its Video index.

Parameters
filenameFilename of the resource.
unloadPolicyWhether to unload the resource at the end of the current Scene, or the game end.
Returns
Returns the index of the Resource.

◆ ReadAllText()

string Resources.ReadAllText ( string path)

Reads all text from the given filename.

Parameters
pathThe path of the resource to read.
Returns
Returns all the text in the resource as a string value if it can be read, otherwise it returns a null value if it cannot be read.