-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Documentation Improvements * Documented slice and substr in string
- Loading branch information
Showing
16 changed files
with
59 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
doc/src/references/builtin/!Datatypes/string/Methods/slice.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
Extracts a substring starting at the given index and ending just before the index end (exclusive). | ||
string string::slice(int start = 0, int end = 0); | ||
## Arguments: | ||
* int start = 0: The index where the substring begins (inclusive). | ||
* int end = 0: The index where the substring ends (exclusive). | ||
## Returns: | ||
string: A new string with the characters modified. | ||
*/ | ||
|
||
// Example: | ||
void main() { | ||
string text = "Hello, world!"; | ||
string substring = text.slice(0, 5); | ||
alert("Info", substring); | ||
text = "Welcome to NVGT"; | ||
substring = text.slice(11, 16); | ||
alert("Info", substring); | ||
} |
16 changes: 16 additions & 0 deletions
16
doc/src/references/builtin/!Datatypes/string/Methods/substr.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
Extracts a substring starting at the given index and containing a specific number of characters. | ||
string string::substr(uint start = 0, int count = -1); | ||
## Arguments: | ||
* uint start = 0: The index where the substring begins (inclusive). | ||
* int count = -1: The number of characters to include in the substring. -1 means all remaining characters after the start index. | ||
## Returns: | ||
string: A new string with the characters modified. | ||
*/ | ||
|
||
// Example: | ||
void main() { | ||
string text = "Hello, world!"; | ||
string substring = text.substr(7, 5); // Extracts "world" | ||
alert("Info", substring); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ry User Interface (form.nvgt)/Global Properties/audioform_input_disable_ralt.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# audioform_input_disable_ralt | ||
Set whether or not the right alt key should be disabled in input boxes, mostly useful for users with non-english keyboards. | ||
Set whether or not the right Alt key should be disabled in input boxes, mostly useful for users with non-english keyboards. | ||
|
||
`bool audioform_input_disable_ralt;` |
4 changes: 2 additions & 2 deletions
4
...rc/references/include/Character Rotation (rotation.nvgt)/!Character Rotation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# character rotation | ||
This include contains functions for moving a rotating character in a 2d or 3d game. | ||
This include contains functions for moving a rotating character in a 2D or 3D game. | ||
|
||
## Disclaimer: | ||
Though these have been improved over the years and though I do use this myself for Survive the Wild and my other games, it should be understood that I started writing this file in bgt when I was only 12 or 13 years old and it has only been getting improved as needed. The result is that anything from the math to the coding decisions may be less than perfect, putting it kindly. You have been warned! | ||
Though these have been improved over the years and though I do use this myself for Survive the Wild and my other games, it should be understood that I started writing this file in BGT when I was only 12 or 13 years old and it has only been getting improved as needed. The result is that anything from the math to the coding decisions may be less than perfect, putting it kindly. You have been warned! |
2 changes: 1 addition & 1 deletion
2
...rc/references/include/Dictionary Retrieval (dget.nvgt)/!dictionary retrieval.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Dictionary retrieval functions | ||
The way you get values out of Angelscript dictionaries by default is fairly annoying, mainly due to its usage of out values instead of returning them. Hence this include, which attempts to simplify things. | ||
The way you get values out of AngelScript dictionaries by default is fairly annoying, mainly due to its usage of out values instead of returning them. Hence this include, which attempts to simplify things. |
2 changes: 1 addition & 1 deletion
2
...c/references/include/INI Reader and Writer (ini.nvgt)/!INI Reader and Writer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# INI Reader and Writer | ||
This is a class designed to read and write ini configuration files. | ||
This is a class designed to read and write INI configuration files. | ||
|
||
I can't promise that the specification will end up being followed to the letter, but I'll try. At this time, though the order of keys and sections will remain the same, the whitespace, comment, and line structure of an externally created ini file may not remain in tact if that file is updated and rewritten using this include. |
2 changes: 1 addition & 1 deletion
2
.../include/INI Reader and Writer (ini.nvgt)/classes/ini/methods/get_error_text.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ces/include/INI Reader and Writer (ini.nvgt)/classes/ini/methods/load_string.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lude/INI Reader and Writer (ini.nvgt)/classes/ini/properties/loaded_filename.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# loaded_filename | ||
Contains the filename of the currently loaded ini data. | ||
Contains the filename of the currently loaded INI data. | ||
|
||
`string loaded_filename;` |
2 changes: 1 addition & 1 deletion
2
.../references/include/Instance Management (instance.nvgt)/!Instance Management.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Instance Management | ||
This include provides the `instance` class, which allows you to manage the way multiple instances of your game are handled. For example, you could use use this class to check if your game is already running, or stop it from running until only one instance exists. | ||
This include provides the `instance` class, which allows you to manage the way multiple instances of your game are handled. For example, you could use this class to check if your game is already running, or stop it from running until only one instance exists. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
doc/src/references/include/Token Generation (token_gen.nvgt)/Functions/!generate_token.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/** | ||
Generates a random string of characters (a token). | ||
string generate_token(int token_length, int mode = token_gen_flag_all) | ||
string generate_token(int token_length, int mode = TOKEN_CHARACTERS | TOKEN_NUMBERS) | ||
## Arguments: | ||
* int token_length: the length of the token to generate. | ||
* int mode = token_gen_flag_all: allows you to specify which characters you would like in the generated token (see remarks). | ||
* int mode = TOKEN_CHARACTERS | TOKEN_NUMBERS: allows you to specify which characters you would like in the generated token (see remarks). | ||
## returns: | ||
String: a random token depending on the mode. | ||
String: a random token depending on the modes. | ||
## Remarks: | ||
This function uses the `generate_custom_token` function to generate. The characters used to generate the token will depend on the mode you specified. See `token_gen_flags` enum constants. | ||
This function uses the `generate_custom_token` function to generate. The characters used to generate the token will depend on the modes you specified. See `token_gen_flags` enum constants for a list of supported modes that can be passed to the mode parameter. | ||
*/ | ||
|
||
// Example: | ||
#include "token_gen.nvgt" | ||
|
||
void main() { | ||
alert("Info", "Your token is: " + generate_token(10)); | ||
alert("Info", "Numbers only token is: " + generate_token(10, token_gen_flag_numbers)); | ||
alert("Info", "Characters only token is: " + generate_token(10, token_gen_flag_characters)); | ||
alert("Info", "Numbers only token is: " + generate_token(10, TOKEN_NUMBERS)); | ||
alert("Info", "Characters only token is: " + generate_token(10, TOKEN_CHARACTERS)); | ||
} |