Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the documentation for SetFloatingHelpTextStyle #856

Merged
merged 7 commits into from
Oct 30, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 57 additions & 7 deletions HUD/SetFloatingHelpTextStyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,64 @@ aliases: ["0x788E7FD431BD67F1"]

```c
// 0x788E7FD431BD67F1 0x97852A82
void SET_FLOATING_HELP_TEXT_STYLE(int hudIndex, int p1, int p2, int p3, int p4, int p5);
void SET_FLOATING_HELP_TEXT_STYLE(int hudIndex, int style, int hudColor, int alpha, int arrowPosition, int boxOffset);
```

## Parameters
* **hudIndex**:
* **p1**:
* **p2**:
* **p3**:
* **p4**:
* **p5**:
* **hudIndex**: The hud index for the floating help message
* **style**: Value 0 won't show an arrow at all. Values 1, 2 and -2 will display an arrow.
* **hudColor**: https://docs.fivem.net/docs/game-references/hud-colors/
* **alpha**: Value for the help box opacity, from 0-255. Anything greater will simply ignore the alpha value. Always 191 in R* scripts.
* **arrowPosition**: Used to set the arrow positon. No value will hide the arrow
* **boxOffset**: Offset for the floating help box. Note: Arrow stays fixed

### Arrow Positions
* 0 = Off / No arrow
* 1 = Top
* 2 = Left
* 3 = Bottom
* 4 = Right

### Note
Any numeric value greater than 4 will result in a right arrow (Index 4)

### Important
Needs to be called every frame
DerDevHD marked this conversation as resolved.
Show resolved Hide resolved

## Examples
```lua
function DisplayHelpText(string)
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName(string)
EndTextCommandDisplayHelp(1, false, false, 0)
end

CreateThread(function()
while true do
Wait(0)

local Ped = PlayerPedId()

DisplayHelpText('Example Text')
SetFloatingHelpTextStyle(0, 2, 2, 0, 3, 0)
SetFloatingHelpTextToEntity(0, Ped, 0, 0)
end
end)
```

```js
function DisplayHelpText(string) {
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName(string)
EndTextCommandDisplayHelp(1, false, false, 0)
}

setTick(() => {
const Ped = PlayerPedId()

DisplayHelpText('Example Text')
SetFloatingHelpTextStyle(0, 2, 2, 0, 3, 0)
SetFloatingHelpTextToEntity(0, Ped, 0, 0)
})
```
![Preview of the example above](https://i.ibb.co/G97hPn7/Image.png)
DerDevHD marked this conversation as resolved.
Show resolved Hide resolved
Loading