• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] progress3D - Create progress bars in 3D space
#1
progress3D

[Image: progress3-D.png]

After the 2D textdraw-based version of progress bars, here now comes the 3D version. This library lets you create progress bars in 3D space. It's basically just two overlapping 3D text labels, one being moved slightly to the right to fill in the gaps between the characters.

Repository

[Image: SAMPCTL-progress3D-03ef651]

Functions

Code:
Bar3D:CreateProgressBar3D(color, bool:borders, Float:x, Float:y, Float:z, Float:max_value, Float:init_value, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, areaid = -1, priority = 0)

Creates a 3D progress bar. Returns INVALID_3D_BAR if bar already exists.

Code:
HideProgressBar3D(Bar3D:barid)

Hide the specified 3D progress bar. Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
ShowProgressBar3D(Bar3D:barid)

Shows the specified 3D progress bar.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
DestroyProgressBar3D(Bar3D:barid)

Destroys the specified progressbar.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
Float:GetProgressBar3DValue(Bar3D:barid)

Returns the current progress value.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
SetProgressBar3DValue(Bar3D_barid, Float:value)

Updates the value of the specified 3D progress bar.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
GetProgressBar3DColor(Bar3D_barid, color)

Returns the color of the specified 3D progress bar.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
SetProgressBar3DColor(Bar3D_barid, color)

Updates the color of the specified 3D progress bar.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
Float:GetProgressBar3DMaxValue(Bar3D:barid)

Returns the maximum value of the specified 3D progress bar.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
SetProgressBar3DMaxValue(Bar3D:barid, Float:max_value)

Updates the maximum value of the specified 3D progress bar. Returns 0 if the max value is smaller than the current value.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
IsValidProgressBar3D(Bar3D:barid)

Returns 1, if the specified 3D progress bar ID is valid and exists.?Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

---

Code:
?PlayerBar3D:CreatePlayerProgressBar3D(playerid, color, bool:borders, Float:x, Float:y, Float:z, Float:max_value, Float:init_value, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, areaid = -1, priority = 0)

Creates a player 3D progress bar. Returns INVALID_PLAYER_3D_BAR if bar already exists.

Code:
?HidePlayerProgressBar3D(playerid, PlayerBar3D:barid)

Hides the specified player 3D progress bar. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?ShowPlayerProgressBar3D(playerid, PlayerBar3D:barid)

Shows the specified player 3D progress bar. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?DestroyPlayerProgressBar3D(playerid, PlayerBar3D:barid)

Destroys a 3D player progress bar. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?Float:GetPlayerProgressBar3DValue(playerid, PlayerBar3D:barid)

Returns the current progress value. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?SetPlayerProgressBar3DValue(playerid, PlayerBar3D:barid, Float:value)

Updates the value of the specified player 3D progress bar. Returns 0 if value is greater than max value. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?GetPlayerProgressBar3DColor(playerid, PlayerBar3D:barid)

Returns the color of the specified player 3D progress bar. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?SetPlayerProgressBar3DColor(playerid, PlayerBar3D:barid, color)

Updates the color of the specified player 3D progress bar. Returns INVALID_GLOBAL_3D_BAR if bar doesn't exist.

Code:
?Float:GetPlayerProgressBar3DMaxValue(playerid, PlayerBar3D:barid)

Returns the maximum value of the specified player 3D progress bar. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?SetPlayerProgressBar3DMaxValue(playerid, PlayerBar3D:barid, Float:max_value)

Updates the maximum value of the specified player 3D progress bar. Returns 0 if the max value is smaller than the current value. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.

Code:
?IsValidPlayerProgressBar3D(playerid, PlayerBar3D:barid)

Returns 1, if the specified player 3D progress bar ID is valid and exists. Returns INVALID_PLAYER_3D_BAR if bar doesn't exist.
  Reply


Messages In This Thread
progress3D - Create progress bars in 3D space - by Manyula - 2019-04-14, 01:30 PM

Forum Jump: