[Include] progress3D - Create progress bars in 3D space
#1

progress3D.inc



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 those gaps between the characters. Have fun with it!

Repository



Functions
  • Bar3D:CreateProgressBar3D(Float:x, Float:y, Float:z, layout, fill_color, background_color, 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.
  • DestroyProgressBar3D(Bar3D:barid)
    • Destroys a 3D progress bar.
  • GetProgressBar3DValue(Bar3D:barid)
    • Returns the current progress value.
  • SetProgressBar3DValue(Bar3D:barid, Float:value)
    • Updates the value of the specified 3D progress bar.
  • GetProgressBar3DFillColor(Bar3D:barid)
    • Returns the fill color of the specified 3D progress bar.
  • SetProgressBar3DFillColor(Bar3D:barid, fill_color)
    • Updates the fill color of the specified 3D progress bar.
  • GetProgressBar3DBackgroundColor(Bar3D:barid)
    • Returns the background color of the specified 3D progress bar.
  • SetProgressBar3DBackgroundColor(Bar3D:barid, background_color)
    • Updates the background color of the specified 3D progress bar.
  • GetProgressBar3DMaxValue(Bar3D:barid)
    • Returns the maximum value of the specified 3D progress bar.
  • SetProgressBar3DMaxValue(Bar3D:barid, Float:max_value)
    • Updates the maximum value of the specified 3D progress bar.
  • GetProgressBar3DLayout(Bar3D:barid)
    • Returns the layout of the specified 3D progress bar.
  • SetProgressBar3DLayout(Bar3D:barid, layout)
    • Updates the layout of the specified 3D progress bar.
  • IsValidProgressBar3D(Bar3D:barid)
    • Returns true, if the specified 3D progress bar ID is valid and exists.
Changelog

v2.0
  • Update to YSI 5
  • Added compatibility for streamer version 2.9.4
  • Fixed a bug in SetProgressBar3DLayout(...) which caused the wrong layout to be applied
  • Minor code refactoring
v1.3.1
  • Moved the position parameters x, y, z to the front of Bar3D:CreateProgressBar3D(...)
  • Slightly improved code readability
v1.3
  • Added a new parameter layout with three new bar layout options
    • BAR_3D_LAYOUT_THIN
    • BAR_3D_LAYOUT_NORMAL
    • BAR_3D_LAYOUT_THICK
  • Added GetProgressBar3DLayout(Bar3D:barid) and SetProgressBar3DLayout(Bar3D:barid, layout)
v1.2.1
  • Fixed getter functions (forgot to add "_:" to the returned value)
v1.2
  • Added the parameter Float:max_value to Bar3D:CreateProgressBar3D(...)
  • Added GetProgressBar3DMaxValue(Bar3D:barid)
  • Added SetProgressBar3DMaxValue(Bar3D:barid, Float:max_value)
  • Updated the testing script
v1.1
  • Code optimizations
  • Internal check if value ranges from 0 to 100.
v1.0
  • Initial release
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)