Skip to content

Commit

Permalink
Add v5 Printing function pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MegAmi24 committed Oct 21, 2024
1 parent 0468f52 commit 2d733c9
Show file tree
Hide file tree
Showing 11 changed files with 433 additions and 1 deletion.
49 changes: 49 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintFloat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# PrintFloat

!!! note
This function only exists in REV02 and above.

## Description
Prints a float value to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The label to call the float.

`fvalue`

: The float value to print.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintFloat(int32 mode, const char *message, float fvalue);
```

=== "C++"

``` cpp
Dev::PrintFloat(PrintModes mode, const char *message, float fvalue);
```

## Example
=== "C"

``` c
RSDK.PrintFloat(PRINT_NORMAL, "distance", distanceFromGoal);
```

=== "C++"

``` cpp
Dev::PrintFloat(Dev::PRINT_NORMAL, "distance", distanceFromGoal);
```
49 changes: 49 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintHitbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# PrintHitbox

!!! note
This function only exists in REV02 and above.

## Description
Prints a Hitbox variable to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The label to call the hitbox.

`hitbox`

: The hitbox to print.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintHitbox(int32 mode, const char *message, Hitbox hitbox);
```

=== "C++"

``` cpp
Dev::PrintHitbox(PrintModes mode, const char *message, Hitbox hitbox);
```

## Example
=== "C"

``` c
RSDK.PrintHitbox(PRINT_NORMAL, "playerHitbox", &self->hitbox);
```

=== "C++"

``` cpp
Dev::PrintHitbox(Dev::PRINT_NORMAL, "playerHitbox", &this->hitbox);
```
49 changes: 49 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintInt32.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# PrintInt32

!!! note
This function only exists in REV02 and above.

## Description
Prints a signed integer to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The label to call the integer.

`integer`

: The signed integer to print.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintInt32(int32 mode, const char *message, int32 integer);
```

=== "C++"

``` cpp
Dev::PrintInt32(PrintModes mode, const char *message, int32 integer);
```

## Example
=== "C"

``` c
RSDK.PrintInt32(PRINT_NORMAL, "health", self->health);
```

=== "C++"

``` cpp
Dev::PrintInt32(Dev::PRINT_NORMAL, "health", this->health);
```
70 changes: 70 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# PrintLog

!!! note
This function only exists in REV02 and above.

## Description
Prints a message to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The message to print.

## Using Variables
You can add additional parameters when calling this function to use variables in the message. To do this, include one of the following flags in `message` to represent the variable depending on its data type:

- `%d` for signed integers
- `%u` for unsigned integers
- `%f` for floats or doubles
- `%c` for characters
- `%s` for strings (const char)

Then, include additional parameter(s) to the function call pointing to the variable(s) to print the value(s) of. Varaiables should be put in the order the corresponding flags appear in `message`.

If you'd like use the `%` character in `message`, use the `%%` flag.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintLog(int32 mode, const char *message, ...);
```

=== "C++"

``` cpp
Dev::Print(PrintModes mode, const char *message, ...);
```

## Examples
=== "C"

``` c
RSDK.PrintLog(PRINT_NORMAL, "This is a test message.");
```
``` c
RSDK.PrintLog(PRINT_NORMAL, "Player has %d HP.", self->health);
```
``` c
RSDK.PrintLog(PRINT_NORMAL, "Level %u is named %s.", levelID, levelName);
```

=== "C++"

``` cpp
Dev::Print(Dev::PRINT_NORMAL, "This is a test message.");
```
``` cpp
Dev::Print(Dev::PRINT_NORMAL, "Player has %d HP.", this->health);
```
``` cpp
Dev::Print(Dev::PRINT_NORMAL, "Level %u is named %s.", levelID, levelName);
```
45 changes: 45 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintString.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# PrintString

!!! note
This function only exists in REV02 and above.

## Description
Prints a String variable to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The String variable to print.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintString(int32 mode, String *message);
```

=== "C++"

``` cpp
Dev::PrintString(PrintModes mode, String *message);
```

## Example
=== "C"

``` c
RSDK.PrintString(PRINT_NORMAL, &string);
```

=== "C++"

``` cpp
Dev::PrintString(Dev::PRINT_NORMAL, &string);
```
45 changes: 45 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# PrintText

!!! note
This function only exists in REV02 and above.

## Description
Prints a `const char` string to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The `const char` value to print.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintText(int32 mode, const char *message);
```

=== "C++"

``` cpp
RSDKTable->PrintText(int32 mode, const char *message);
```

## Example
=== "C"

``` c
RSDK.PrintText(PRINT_NORMAL, "This is a test message.");
```

=== "C++"

``` cpp
RSDKTable->PrintText(Dev::PRINT_NORMAL, "This is a test message.");
```
49 changes: 49 additions & 0 deletions docs/RSDKv5/Functions/Printing/PrintUInt32.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# PrintUInt32

!!! note
This function only exists in REV02 and above.

## Description
Prints an unsigned integer to the console.

## Parameters
`mode`

: The [print mode](TODO) of the message.

`message`

: The label to call the integer.

`integer`

: The unsigned integer to print.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.PrintUInt32(int32 mode, const char *message, uint32 integer);
```

=== "C++"

``` cpp
Dev::PrintUInt32(PrintModes mode, const char *message, uint32 integer);
```

## Example
=== "C"

``` c
RSDK.PrintUInt32(PRINT_NORMAL, "health", self->health);
```

=== "C++"

``` cpp
Dev::PrintUInt32(Dev::PRINT_NORMAL, "health", this->health);
```
Loading

0 comments on commit 2d733c9

Please sign in to comment.