Atlas Image by mob-sakai - 22

GUIExtensions

AtlasImage is a graphic component use SpriteAtlas for uGUI. In addition, add useful sprite selector and border editor to the inspector.

Unity 2017.1.0p5MIT LicenseUpdated 18 days agoCreated on April 30th, 2018
Go to source

AtlasImage

AtlasImage is a component that use SpriteAtlas for UI. In addition, add useful sprite selector and border editor to the inspector.

image

<< Description | Demo | Download | Usage | Development Note | Change log >>





Description

Are you still fatigued with SpriteAtlas and Image?
AtlasImage provides useful feature to use SpriteAtlas for UI.

Sprite for renderring can be changed using a SpriteAtlas and a sprite name.

atlasImage.spriteAtlas = Resources.Load("A SpriteAtlas name") as SpriteAtlas;
atlasImage.spriteName = "A sprite name in the SpriteAtlas";

In the inspector, sprite selection window shows only sprites in SpriteAtlas.

image

You can edit the border in the preview window.

image





Demo





Usage

  1. Download AtlasImage.unitypackage from Releases.
  2. Import the package into your Unity project. Go to Assets > Import Package > Custom Package and select AtlasImage.unitypackage.
  3. Enable SpriteAtlas. Go to Edit > Project Settings > Editor, and change the sprite packing mode from Disabled to either:
    • Enabled for Builds, when you want to use packing for builds only and not when in Play mode.
    • Always Enabled when you want the packed Sprite to resolve its texture from the Sprite Atlas during Play mode, but resolve its texture from the original Texture during Edit mode.
  4. Add AtlasImage component instead of Image component from Add Component in inspector.
  5. Select the SpriteAtlas by dropdown manu, and select the Sprite by ObjectSelectorWindow.
  6. Enjoy!
Requirement
  • Unity 2017.1+
  • No other SDK are required





Development Note





License

Author

mob-sakai

See Also

Show all projects by mob-sakai