{"id":22813371,"url":"https://github.com/southclaws/progress2","last_synced_at":"2025-03-30T21:46:25.038Z","repository":{"id":20767559,"uuid":"24052280","full_name":"Southclaws/progress2","owner":"Southclaws","description":"A SA:MP UI library for rendering progress bars used to visualise all manner of data from health to a countdown timer.","archived":false,"fork":false,"pushed_at":"2023-05-18T12:48:14.000Z","size":222,"stargazers_count":69,"open_issues_count":5,"forks_count":64,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-06T02:41:59.352Z","etag":null,"topics":["library","pawn-package","sa-mp","ui"],"latest_commit_sha":null,"homepage":null,"language":"Pawn","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Southclaws.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-15T10:27:16.000Z","updated_at":"2025-02-05T12:09:00.000Z","dependencies_parsed_at":"2024-12-12T12:30:54.387Z","dependency_job_id":"893a0ef6-c5e9-4814-8760-ba178f505721","html_url":"https://github.com/Southclaws/progress2","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fprogress2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fprogress2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fprogress2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Southclaws%2Fprogress2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Southclaws","download_url":"https://codeload.github.com/Southclaws/progress2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246385384,"owners_count":20768668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","pawn-package","sa-mp","ui"],"created_at":"2024-12-12T12:27:07.716Z","updated_at":"2025-03-30T21:46:25.016Z","avatar_url":"https://github.com/Southclaws.png","language":"Pawn","funding_links":[],"categories":[],"sub_categories":[],"readme":"# progress2.inc\n\nA SA:MP UI library for rendering progress bars used to visualise all manner of data from health to a countdown timer.\n\nLibrary originally written by Flávio Toribio, Now maintained by Southclaws in version 2+ with new features.\n\n![Bars 1](bars-horizontal.gif)\n\n![Bars 2](bars-vertical.gif)\n\n![Bars 3](bars-all.gif)\n\n## Installation\n\nSimply install to your project:\n\n```bash\nsampctl package install Southclaws/progress2\n```\n\nInclude in your code and begin using the library:\n\n```pawn\n#include \u003cprogress2\u003e\n```\n\n## Usage\n\n### Constants\n\n* `MAX_PLAYER_BARS`:\n  * Defaults to the textdraw limit divided by 3.\n* `INVALID_PLAYER_BAR_VALUE`:\n  * Invalid return value for interface functions.\n* `INVALID_PLAYER_BAR_ID`:\n  * Invalid bar ID value.\n* `BAR_DIRECTION_RIGHT`:\n  * Bar direction left-to-right\n* `BAR_DIRECTION_LEFT`:\n  * Bar direction right-to-left\n* `BAR_DIRECTION_UP`:\n  * Bar direction bottom to top\n* `BAR_DIRECTION_DOWN`:\n  * Bar direction top to bottom\n* `BAR_DIRECTION_HORIZONTAL_FROM_0`\n  * Bar direction left to right and starts from 0.0 in case min_value and max_value have different signs.\n* `BAR_DIRECTION_VERTICAL_FROM_0`\n  * Bar direction down to up and starts from 0.0 in case min_value and max_value have different signs.\n\n### Functions\n\n* `PlayerBar:CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width = 55.5, Float:height = 3.2, colour, Float:max = 100.0, direction = BAR_DIRECTION_RIGHT)`:\n  * Creates a progress bar for a player.\n* `DestroyPlayerProgressBar(playerid, PlayerBar:barid)`:\n  * Destroys a player's progress bar.\n* `ShowPlayerProgressBar(playerid, PlayerBar:barid)`:\n  * Shows a player's progress bar to them.\n* `HidePlayerProgressBar(playerid, PlayerBar:barid)`:\n  * Hides a player's progress bar from them.\n* `IsValidPlayerProgressBar(playerid, PlayerBar:barid)`:\n  * Returns true if the input bar ID is valid and exists.\n* `GetPlayerProgressBarPos(playerid, PlayerBar:barid, \u0026Float:x, \u0026Float:y)`:\n  * Returns the on-screen position of the specified progress bar.\n* `SetPlayerProgressBarPos(playerid, PlayerBar:barid, Float:x, Float:y)`:\n  * Updates the position for a progress bar and re-renders it.\n* `Float:GetPlayerProgressBarWidth(playerid, PlayerBar:barid)`:\n  * Returns the width of a progress bar.\n* `SetPlayerProgressBarWidth(playerid, PlayerBar:barid, Float:width)`:\n  * Updates the width of a progress bar and re-renders it.\n* `Float:GetPlayerProgressBarHeight(playerid, PlayerBar:barid)`:\n  * Returns the height of a progress bar.\n* `SetPlayerProgressBarHeight(playerid, PlayerBar:barid, Float:height)`:\n  * Updates the height of a progress bar and re-renders it.\n* `GetPlayerProgressBarColour(playerid, PlayerBar:barid)`:\n  * Returns the colour of a progress bar.\n* `SetPlayerProgressBarColour(playerid, PlayerBar:barid, colour)`:\n  * Sets the colour of a progress bar.\n* `Float:GetPlayerProgressBarMinValue(playerid, PlayerBar:barid)`\n  * Returns the minumum value of a progress bar.\n* `SetPlayerProgressBarMinValue(playerid, PlayerBar:barid, Float:min_value)`\n  * Sets the minumum value that a progress bar represents.\n* `Float:GetPlayerProgressBarMaxValue(playerid, PlayerBar:barid)`:\n  * Returns the maximum value of a progress bar.\n* `SetPlayerProgressBarMaxValue(playerid, PlayerBar:barid, Float:max)`:\n  * Sets the maximum value that a progress bar represents.\n* `Float:GetPlayerProgressBarValue(playerid, PlayerBar:barid)`:\n  * Returns the value a progress bar represents.\n* `SetPlayerProgressBarValue(playerid, PlayerBar:barid, Float:value)`:\n  * Sets the value a progress bar represents.\n* `progressbar_direction:GetPlayerProgressBarDirection(playerid, PlayerBar:barid)`:\n  * Returns the direction of a progress bar.\n* `SetPlayerProgressBarDirection(playerid, PlayerBar:barid, progressbar_direction:direction)`:\n  * Updates the direction for a progress bar and re-renders it.\n* `GetPlayerProgressBarPadding(playerid, PlayerBar:barid, \u0026Float:padding_x, \u0026Float:padding_y)`\n  * Receives current padding for both dimensions.\n* `SetPlayerProgressBarPadding(playerid, PlayerBar:barid, Float:padding_x, Float:padding_y)`\n  * Updates current padding for both dimensions.\n\n### Internal\n\n* `_RenderBar(playerid, barid)`:\n  * Renders a valid bar on-screen using it's current properties. Called on creation and whenever position, width or height are updated.\n\n### Hooked\n\n* `OnScriptInit`:\n  * When y_iterate is used, initialises iterators.\n* `OnPlayerDisconnect`:\n  * To automatically destroy bars when a player disconnects.\n\n## Testing\n\nTo test, simply run the package:\n\n```bash\nsampctl package run\n```\n\nAnd connect to `localhost:7777` to test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouthclaws%2Fprogress2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsouthclaws%2Fprogress2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsouthclaws%2Fprogress2/lists"}