# Two-dimensional resource production

This chapter mainly introduces how to make resources such as pictures, fonts, and atlases in the tool.

# Texture making

Texture2D

Put the picture resource (png/jpg) into the project and it will be processed automatically.

# Picture slice

SpriteFrame

# texutre2D build SpriteFrame

Texture2d can correspond to a SpriteFrame. Process: Project panel click on the picture-imageType select spriteframe-Spriteframe is automatically generated texutre2D build spriteFrame

# Manually create a new SpriteFrame

Texture2d can correspond to multiple spriteFrame. Process: Project panel Right click-New-Image-spriteframe-Inspector panel imageFile is set to the image used-Change the size of Rect Manually build spriteFreame

# SpriteFrame properties

Rect: In the normal rendering mode Simple, use this area for rendering. SlicedRect: Under the sliced ​​nine-square grid, use this area for rendering, stretch in the middle, and have a fixed size around it. slicedRect

Atlasspace

# Atlasspace production

  1. Create an atlas folder, Create a new atlas folder, and put the picture resources into the corresponding folder
  2. Create a new atlas, Right click-New-Image-atlasspac
  3. Generate spriteframe from atlas pictures, Enter the atlas folder-select all images-select spriteframe for imageType
  4. The picture set is bound to the picture resource, Select atlasspac-select the desired folder to be combined
  5. Generate atlas, Click to preview the gallery Atlas bound image resource

# Atlasspace atlas usage

Directly use each picture slice inside the atlas

# Text resources

# TTF font production

  1. Put the text resource ttf into the project

  2. Create a new font, Right click-New-Font-font New font

  3. Bind font resources, Select font-fontFamily to select the corresponding ttf ttfFont

# BitmapFont Bitmap Font Making

  1. Create a bitmap font folder, name the bitmap font, Create a new bitmap font folder, and put the required bitmap font pictures into the corresponding folder, and the merged characters are mapped according to the picture naming.
  2. Create a new bitmapFont, Right click-New-font-bitmapFont
  3. Generate spriteframe from atlas pictures, Enter the bitmap font folder-select all images-select spriteframe for imageType
  4. Bound image resources with bitmapFont, bitmapFont-select the desired bitmap font folder
  5. Save the bitmap font, Click to save bitmapFont configuration
  6. Edit the bitmap font, Edit configuration table properties-click save bitmapFont configuration save bitmapFont
点击咨询小助手