-
Notifications
You must be signed in to change notification settings - Fork 0
Using Your Own Artwork
Generated from the thetowersdk repository. Edits made here are overwritten on the next push — change the source file instead.
This package ships no artwork and no index of it. The art is TechTree Games’, and it is not this package’s to redistribute.
What ships is the naming rule, so a tool can find a file in a directory of artwork you supply.
import { gameAssetPath, gameAssetPaths, towerAssetUrl, assetSlug } from 'thetowersdk/assets'
gameAssetPath('Amplifying Strike', { domain: 'modules' })
// 'modules/amplifying-strike-md.webp'
gameAssetPaths('Om Chip', { domain: 'modules' })
// { sm: 'modules/om-chip-sm.webp', md: '…-md.webp', lg: '…-lg.webp' }
towerAssetUrl(gameAssetPath('Om Chip', { domain: 'modules' }), '/art')
// '/art/modules/om-chip-md.webp'<your art root>/
modules/amplifying-strike-sm.webp
modules/amplifying-strike-md.webp
modules/amplifying-strike-lg.webp
cards/… relics/… enemies/… guardians/… perks/…
One directory per domain, one file per size, named <slug>-<size>.<ext>. The slug is the name
lowercased with runs of non-alphanumerics collapsed to a single hyphen — Om Chip becomes
om-chip, Damage / Meter becomes damage-meter. assetSlug() applies exactly that rule, so
name your files with it rather than reimplementing it: two implementations of one convention is
how a name stops matching its file.
ASSET_DOMAINS lists the directory names, ASSET_SIZES the sizes. Use whichever subset you have
— nothing requires all three sizes, and extension overrides webp if your files are png.
These functions never touch the disk, because the disk is yours. A path pointing at a file you do
not have renders as a gap rather than throwing, so verify your own directory once at startup
instead of trusting a returned string. null comes back only when a name slugifies to nothing,
which stops modules/-md.webp from ever looking like a real path.
Generated from TheTowerSDK — do not edit here. Docs and live demos: https://tmrxjd.github.io/TheTowerSDK/
- Quick Start
- Entry Points
- How It Fits Together
- Getting a Save File
- Reading a Save
- Reading The Community Wiki
- Formulas
- Builders
- Charts
- Effective Paths
- Examples
- Templates
- Building a Bot On This
- Google Sheets
- Desktop and Mobile
- Optional Add-ons
- Using It With An AI Agent
- Using Your Own Artwork
- Names And Acronyms
- Patch Notes
- Accuracy
- Versioning
- Where the Docs Live
- Contributing
- Credits
- License
Guides
Examples
- 01-browse-game-data.ts
- 02-read-a-save-file.ts
- 03-plan-upgrades-from-a-save.ts
- 04-generate-a-chart.ts
- 05-generate-a-cost-table.ts
- 06-read-the-community-wiki.ts
- 07-format-like-the-game.ts
- 08-build-a-calculator.ts
- 09-build-a-bot.ts
- 10-read-a-sheet.ts
- 11-build-a-knowledge-base.ts
- 12-show-module-and-card-art.ts
Templates