adventuregamestudio / ags-manual

AGS documentation.
https://adventuregamestudio.github.io/ags-manual/
MIT License
28 stars 9 forks source link

Document added System entries (GetEngineInteger and GetEngineString) #260

Open ericoporto opened 5 days ago

ericoporto commented 5 days ago

https://github.com/adventuregamestudio/ags-manual/wiki/System

  /// Gets a runtime engine value represented as integer by the given identifier; is meant for diagnostic purposes only
  import static int GetEngineInteger(EngineValueID value, int index = 0); // $AUTOCOMPLETESTATICONLY$
  /// Gets a runtime engine string by the given identifier; is meant for diagnostic purposes only
  import static String GetEngineString(EngineValueID value, int index = 0); // $AUTOCOMPLETESTATICONLY$

Examples of using it

int spritecachemax = System.GetEngineInteger(ENGINE_VALUE_I_SPRCACHE_MAXNORMAL);
int spritecachecurrent = System.GetEngineInteger(ENGINE_VALUE_I_SPRCACHE_NORMAL);
int spritecachepercent = spritecachecurrent * 100 / spritecachemax;
lblInfo.Text = String.Format("Sprite cache: %d / %d (%d%%)", spritecachecurrent, spritecachemax, spritecachepercent);

These were originally added in this PR https://github.com/adventuregamestudio/ags/pull/2358

The enums are documented in #259