{"id":15762457,"url":"https://github.com/williamvenner/glua-material-avatar","last_synced_at":"2025-05-08T19:41:46.819Z","repository":{"id":109206163,"uuid":"352819900","full_name":"WilliamVenner/glua-material-avatar","owner":"WilliamVenner","description":"Simple script demonstrating how to download Steam avatars and generate a Material from them using clientside GLua.","archived":false,"fork":false,"pushed_at":"2022-07-21T14:20:23.000Z","size":8,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-11T11:35:28.415Z","etag":null,"topics":["avatar","circle","garry","garrys","garrysmod","glua","gmod","http","lua","material","picture","profile","steam","vgui"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliamVenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-03-30T00:14:57.000Z","updated_at":"2024-09-07T17:47:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"b560a3f0-e8b8-4041-b71d-0a9ab5d126f0","html_url":"https://github.com/WilliamVenner/glua-material-avatar","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"c5f64997a22fcc9eefcd73532ba8a1805e0ae32d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fglua-material-avatar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fglua-material-avatar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fglua-material-avatar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fglua-material-avatar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/glua-material-avatar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253135450,"owners_count":21859646,"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":["avatar","circle","garry","garrys","garrysmod","glua","gmod","http","lua","material","picture","profile","steam","vgui"],"created_at":"2024-10-04T11:09:17.158Z","updated_at":"2025-05-08T19:41:46.762Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Lua","readme":"# glua-material-avatar\n\nSimple script demonstrating how to download Steam avatars and generate a Material from them using clientside GLua.\n\nThis script is particularly stringent and applies a lot of defensive programming techniques.\n\nAvatar images are cached for 1 day and 1 server session.\n\n## Circle Avatars\n\nThis code could be combined with [Circles!](https://github.com/SneakySquid/Circles) to produce a textured circular avatar.\n\n## Examples\n\n### Basic Example\n\n```lua\ngetAvatarMaterial(LocalPlayer():SteamID64(), function(mat)\n\tprint(\"Downloaded\", mat)\nend)\n```\n\n### HUDPaint Example\n\n```lua\nlocal avatar, downloaded = ( Material(\"vgui/avatar_default\") )\nhook.Add(\"HUDPaint\", \"showMyAvatar\", function()\n\tif not downloaded then\n\t\tdownloaded = true\n\t\t-- NEVER call this every frame unless you are planning on DDoSing Steam.\n\t\tgetAvatarMaterial(LocalPlayer():SteamID64(), function(mat)\n\t\t\tavatar = mat\n\t\tend)\n\tend\n\n\tsurface.SetDrawColor(255, 255, 255)\n\tsurface.SetMaterial(avatar)\n\tsurface.DrawTexturedRect(50, 50, 128, 128)\nend)\n```\n\n### VGUI Element Example\n\n```lua\ninclude(\"vgui-element.lua\")\n\nlocal avatar = vgui.Create(\"AvatarMaterial\")\navatar:SetSize(128, 128)\navatar:SetPos(50, 200)\navatar:SetSteamID64(LocalPlayer():SteamID64())\n--avatar:SetPlayer(LocalPlayer())\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fglua-material-avatar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fglua-material-avatar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fglua-material-avatar/lists"}