rsprite@main
RSprite
A Lua library for looking up, searching and drawing RS3 sprites by name.
Updated 19 November 2026
- Status
- Live
- Version
- v0.1.3
- Licence
- PolyForm Strict 1.0.0
- Sprites indexed
- 36,493 on build 950-1
- Dependencies
- None
plugin.jsonThe plugin's manifest, as the Plugin Hub reads it
{
"name": "rsprite",
"version": "0.1.3",
"requiredDependencies": {},
"optionalDependencies": {},
"requiredPermissions": [],
"optionalPermissions": [],
"hasRibbonIcon": false,
"hasSettingsIcon": false
}Installation
#- Add the dependency. Add RSprite to your plugin's
plugin.jsonas a required dependency.plugin.json { "requiredDependencies": { "rsprite": "rsprite" } } - Publish as usual. When a player installs your plugin from the Plugin Hub, RSprite is downloaded with it automatically.
- Load it while you develop. Download the
rspritezip from the newest release on the GitHub releases page and unzip it into the client's development plugins folder. In the console, runprf, thenprl rsprite, then load your plugin.
RSprite is available as the global rsprite, with no require. Before you publish, replace "rsprite" with RSprite's Plugin Hub ID so players get it downloaded with your plugin.
Example
#local attackId = rsprite.Get("SKILL_ATTACK")
local icon = rsprite.Draw(parent, { "SKILL_NECROMANCY", "BP3_MISSION_ICON_SKILL_NECROMANCY" }, {
x = 10,
y = 10,
size = 24,
})
local ring = rsprite.DrawItem(parent, 13562, { x = 40, y = 10, size = 24 })API
#Sprite names and IDs are read from the running client, so they always match the current game build. Sprites known to crash the client are treated as missing everywhere.
A missing sprite returns nil and logs one rsprite: warning per name. An invalid argument or an unknown option raises an error at the caller's line. A failure inside the client is logged as a warning and never raises.
A chain is one source or an array of sources. Each source is a sprite name, a sprite ID or a plugin resource such as Plugin.resources.my_icon, and the first one that exists is used. A nil ends the array, so a chain must not contain gaps.
| Function | Description |
|---|---|
rsprite.version | The library version as a string, such as "0.1.3". |
rsprite.Get(name) | The sprite ID for a name, or nil. Case insensitive and cached for the session. |
rsprite.Name(id) | The sprite name for an ID, or nil. Cached for the session. An ID that is not a whole number 0 or above gives nil. |
rsprite.Resolve(nameOrChain) | The first existing source in a chain, as a sprite ID or resource handle, and its position in the chain. Returns nil when none exists. Draws nothing. |
rsprite.Draw(parent, nameOrChain, options) | Creates a clickthrough ui.Sprite in parent from the first existing source. Returns the sprite and the chain position used, or the sprite and nil when nothing in the chain exists. |
rsprite.SetSource(sprite, nameOrChain, options) | Points an existing sprite at a new chain and clears any item icon RSprite set on it. Returns the chain position used, or nil. |
rsprite.DrawItem(parent, itemId, options) | Creates a clickthrough ui.Sprite in parent showing an item icon, and returns it. An itemId of nil gives a hidden sprite with no warning. |
rsprite.SetItem(sprite, itemId, options) | Shows an item icon on an existing sprite. Returns true when an item is shown. An itemId of nil clears and hides the sprite and returns false. |
rsprite.Find(text, options) | Searches sprite names, tags and aliases, ignoring case. Returns a page of entries { name, id, tags, aliases, width, height } and the total match count. An empty text lists every sprite. |
rsprite.Tags() | Every tag you can filter by, sorted alphabetically. |
rsprite.BuildIndex(onReady) | Builds the search index over several ticks, then calls onReady, if given, with the sprite count. Calls it straight away if the index is already ready. |
rsprite.IsIndexReady() | Whether the search index is ready. |
| Option | Used by | Description |
|---|---|---|
x, y | Draw, DrawItem | Position in the parent. Any finite number. Default 0. |
xAnchor, yAnchor | Draw, DrawItem | Anchor as a fraction of the parent's width and height. Any finite number. Default 0. |
size | Draw, DrawItem | Width and height, above 0. Default 24. |
width, height | Draw, DrawItem | Separate dimensions above 0, overriding size. |
colour | Draw, SetSource | Tint as a packed 0xRRGGBBAA number. |
alpha | Draw, SetSource | Opacity from 0 to 1. |
quantity | DrawItem, SetItem | Stack count shown on the item, a whole number 0 or above. Without it no count is shown. |
placeholder | Draw, SetSource, DrawItem, SetItem | Whether to show the placeholder when no source exists or the item ID is not valid. Default true. |
tags, limit, offset | Find | Tags every result must have, the page size (default 50) and the number of matches to skip (default 0). |
Call rsprite.BuildIndex() at startup if you use search. Otherwise the first Find builds the whole index at once.
Report incorrect sprite names, sprites that crash the client, and tag or alias requests as issues on the RSprite repository.
Troubleshooting
#The rsprite global is nil in my plugin
While you develop, run prf, then prl rsprite, then load your plugin. Check that RSprite is a required dependency in your plugin.json.
Players do not get RSprite with my plugin
Before you publish, replace "rsprite" with RSprite's Plugin Hub ID in requiredDependencies.
The plugin does not appear after installing
Open the Plugin Hub, go to Manage, and check that the plugin and PrettyUI are both turned on. If it still does not show, close RS3 and open it again.
Still stuck? Report a bug.
Known issues
#No known issues right now.
Coming next
#What I am working on next. Plans can change.
planned
- To do. Update the documentation to show it is on the Plugin Hub Type tidyCurrently live at version 0.1.3
- To do. Simplify the commit message rules Type repoRemove emoji from commit and pull request titles
- To do. Make the repository public Type releaseTested through FashionScape