tModLoader wiki
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # What is a Sprite? A "Sprite" refers to 2D graphics typically found in 2D games. For example, the Gold Bar item sprite, `Item_19.png`, looks like this: ![Item_19](https://user-images.githubusercontent.com/4522492/159594962-1a594c3c-cd6c-4741-b60e-f8409461d845.png) . When making mods, you'll typically need to make a sprite for each bit of visual content you add to your mod. This guide will teach you the basics of spriting and how sprites work in relation to tModLoader. ## Sprite Frame Many sprites have several "frames" within a single image - usually referred to as spritesheets. These are typically used for animation or variation. For example, the GiantBee projectile looks like this: ![](https://i.imgur.com/jRhab1A.png) You can find this texture in your extracted copy of the vanilla textures by finding `Projectile_566.png`. The game was told by the programmer that this sprite has 4 frames in it, so the game knows to split the 96 pixel high texture into 4 equally sized 24 pixel high sections. The game cycles between these 4 frames as the game draws this projectile Some sprite frames are for variety. Here is the Metal Bars sprite, `Tiles_239.png`, this sprite is shared between all metal bar tiles: ![](https://camo.githubusercontent.com/9781684c4d69c2de30fc3495148a112bf50207246f4dbf1da36bb5a7afa28620/68747470733a2f2f692e696d6775722e636f6d2f62716f794c71542e706e67) Spriting tiles is a full topic for itself, please consult the [Basic Tile](https://github.com/tModLoader/tModLoader/wiki/Basic-Tile#framed-vs-frameimportant-tiles) guide and confirm specifics with your programmer before making tile sprites. ## File Format Every tModLoader sprite must be a .png file. As long as you don't mess with settings in your program, saving as a .png should work fine. ## Sprite Making Tools You **will need** to download a capable art / spriting program. MSPaint will not work. See [](https://github.com/tModLoader/tModLoader/wiki/Basic-Prerequisites#drawing-program) to find a list of suitable programs. The rest of this guide will use Aseprite in example diagrams, but any of these programs should have similar capabilities. While the full version costs money, Aseprite does offer a free compilable version that is 100% safe and legal to use. You can compile it by using [this guide](https://github.com/aseprite/aseprite/blob/main/INSTALL.md). Other spriting programs that are recommended include, but are not limited to: * [Piskel](https://www.piskelapp.com/) * [GIMP](https://www.gimp.org/) * [LibreSprite](https://libresprite.github.io/#!/) * [paint.NET](https://www.getpaint.net/) ## Vanilla Sprite Resources Before getting started, we recommend extracting the vanilla sprites to a folder you can easily access. We will be using the `C:\Documents\My Games\Terraria\ModLoader\VanillaTextures` folder in this guide. To do this, follow [this guide](https://github.com/tModLoader/tModLoader/wiki/Intermediate-Prerequisites#vanilla-texture-file-reference). We will be using these textures as guides for sizing and orientation of similar content we will be making in our mod. If you just need a reference for how big various vanilla textures are, you can consult this [text file](https://forums.terraria.org/index.php?attachments/sprite-information-spreadsheet-tsv.314022/). ## Live Editing Sprites If you need to make slight adjustments to a tile or armor texture, it can be very time consuming to make sprite changes, rebuild the mod, reload mods, then test in-game to see if the changes were correct. You can use a mod called "Modders Toolkit" to edit textures live in-game. Follow the video below to see how that is done. After making changes, you'll need to copy the changed png back to the mod sources folder. ![](https://thumbs.gfycat.com/KaleidoscopicClosedBeardeddragon-max-1mb.gif) [HQ Version](https://gfycat.com/KaleidoscopicClosedBeardeddragon) ## Making Sprites ### 2x2 Pixels Terraria uses a pixel art style where each pixel is actually a 2x2 block of pixels. You do not have to follow this art style, but be aware of this concept. If you would like to follow this style, you can simplify your efforts by drawing in normal pixels and scaling your resulting sprite by 200% while using the "Nearest Neighbor" option when resizing. Note that this will also change the padding from 2 pixels to 1. If somehow your sprite upscales incorrectly, a common term you may see thrown around is mixels. A "mixel" refers to mixed sized pixels within a sprite, leading to inconsistency and making the sprite appear messy. It is recommended to always sprite in 1x1 pixels and then upscale to 2x2, not the other way around or with a mixture of the two. The left side of this example has inconsistent pixel sizes, whereas the right keeps it consistent. The right ends up looking cleaner since it is consistent within itself. ![](https://i.imgur.com/06pNr1r.png) ### Dimensions The dimension of a sprite refers to the height and width the sprite is comprised of. For example, a sprite that is 20 pixels wide and 20 pixels tall would be a 20x20 sprite. The maximum dimensions a sprite can be is 2048x2048 before being resized - so 1024x1024 before being resized to 2x2. ## Art Tools ## Padding When a sprite has several frames, we use padding to separate the individual frames. By default, Terraria expects 2 pixels of padding between each frame. For horizontally laid out frames, this means 2 pixels of padding below each frame, even the last one. Here is the GiantBee projectile sprite with magenta padding drawn in to show where padding goes. ![](https://i.imgur.com/CYsKgX3.png) For tiles, the padding goes to the right and below each frame. ## Animation Animation is done by including several frames of animation within your sprite. Make sure the frames are evenly spaced. --Example here of incorrect spacing, then fixed with guidelines showing padding and even texture splitting-- Animation typically loops, but custom animation cycles are also possible. The animation speed and pattern are up to your programmer, so the details of that are found in separate guides. * [Projectile Animation Code Guide](https://github.com/tModLoader/tModLoader/wiki/Basic-Projectile#animationmultiple-frames) ## Orientation Many things in Terraria have an expected orientation. For example, NPC sprites usually face left ![](https://i.imgur.com/PhcRvIa.png), arrow projectiles point up ![](https://i.imgur.com/ogDFqEa.png), and staff point to top right ![](https://i.imgur.com/ax451LJ.png). These conventions are useful to follow because the code drawing these sprites expects the sprites to be oriented in a specific manner. Hitboxes and drawing will be wonky if you do not follow these conventions. Consult the most similar vanilla sprite for a good idea on how to orient your sprite. ### Projectile ### Glowmasks Glowmasks refer to a separate sprite that is drawn at full brightness regardless of lighting. This is typically used for glowing lights on weapons. For example, the regular VortexDrill item sprite, ![](https://i.imgur.com/Oa54l03.png), can only be seen when there is light around, but the corresponding glowmask sprite, ![](https://i.imgur.com/dNTFMTM.png), is drawn in full brightness regardless of nearby lights: ![](https://i.imgur.com/jjV8Txq.png) ![](https://i.imgur.com/hGEHjCu.png) To make a glowmask sprite, make a copy of the original sprite and remove all pixels that shouldn't "glow". Your programmer will then need to write some code to make it draw correctly. # Example Here we will make a sprite for a sword. First, I'll look at a similar vanilla sword sprite to get an idea on how big I want to make it. First, I'll look up a weapon with the size I'm interested in on the wiki. Lets go with [Muramasa](https://terraria.wiki.gg/wiki/Muramasa). The item sprites on the wiki aren't exactly the same as the actual sprites, so don't use that sprite. Instead, find the ItemID by looking for "Internal Item ID: ###" in the infobox. Here we see the number is 155, so open up your copy of the extracted vanilla sprites and find `Item_155.png`. Open this file in your sprite editor and use Save As to save a copy of this file to the folder where you are saving your sprites. Now, feel free to draw a sword while keeping the same orientation and general size. Take note of the 2x2 pixels as well. By using this approach, you will make a sprite that will appear the same size as a vanilla weapon. In this case, the sprite is 58x58 pixels. With time, you'll learn the conventions of various entity sizes and be able to make sprites without needing vanilla texture guides. # Making Good Pixel Art This guide has focused on the technical details of how sprites are structured and how to integrate them into your mod. If you find making sprites difficult, it may be worth finding an artist friend to collaborate with. If, however, you want to further develop your artistic skills, there are many learning resources on the internet to guide you. Joining the [tModLoader Discord server](https://tmodloader.net/discord) and visiting the `#spriting` channel is a great way to get advice and feedback from other spriters. Here are some links to other learning resources: * [The Ultimate Pixel Art Tutorial (Video)](https://www.youtube.com/watch?v=lfR7Qj04-UA)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully