Class Constructors

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
m (Change link to library reference, not language reference)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
*[[TrainzScript Langage Reference|API Hierarchy]]
+
*[[TrainzScript Library Reference|API Hierarchy]]
 
**Constructors
 
**Constructors
 
<br>
 
<br>

Latest revision as of 23:47, 28 December 2020


  • A static class providing the ability to create instances of certain other classes from script.
  • Trainzscript does not normally allow game classs to be created in script, these methods allow for exceptions to this rule.
  • The implementation is liable to change.


Contents

[edit] GetTrainzAsset

public native Asset GetTrainzAsset(void)
Parameters
  • None
Returned Value
  • The global Trainz asset.
Notes
  • This method is used mainly by the built-in classes.


[edit] GetTrainzStrings

public native StringTable GetTrainzStrings(void)
Parameters
  • None
Returned Value
  • The global Trainz StringTable.
Notes
  • This method is used mainly by the built-in classes.


[edit] NewBrowser

public native Browser NewBrowser(void)
Parameters
  • None
Returned Value
  • A new empty Browser object.
Syntax
Browser browser = Constructors.NewBrowser();
Notes


[edit] NewDriverCommand

public native DriverCommand NewDriverCommand(Asset command)
Parameters
  • command = reference to a DriverCommand asset from which the new command instance will be constructed.
Returned Value
  • A new DriverCommand instance for script use.
Notes
  • This method does not add a new command to the list of available driver commands returned by World.GetDriverCommandList() but simply creates a script instance for private use.


[edit] NewDriverCommands

public native DriverCommands NewDriverCommands(void)
Parameters
  • None
Returned Value
  • A new empty DriverCommands list.
Notes


[edit] NewKUIDList

public native KUIDList NewKUIDList(void)
Parameters
  • None
Returned Value
  • A new KUIDList object, empty and unlocked.
Syntax
KUIDList consist = Constructors.NewKUIDList();
Notes


[edit] NewMenu

public native Menu NewMenu(void)
Parameters
  • None
Returned Value
  • A new empty Menu object.
Syntax
Menu menu = Constructors.NewMenu();
Notes
  • The menu returned is for setup purposes only, this method does not create any visual representation.


[edit] NewProductFilter

public native ProdutFilter NewProducFilter(void)
Parameters
  • None
Returned Value
  • A new ProdutFlter object, empty and unlocked.
Syntax
ProductFilter filter = Constructors.NewProductFilter();
Notes


[edit] NewSoup

public native Soup NewSoup(void)
Parameters
  • None
Returned Value
  • A new Soup object, empty and unlocked.
Syntax
Soup soup = Constructors.NewSoup();
Notes



[edit] Categories

Personal tools