Skip to content

kyubuns/Auto9Slicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto9Slicer

Auto 9 slice sprite generator on Unity.

output

Instructions

  • Package Manager https://github.com/kyubuns/Auto9Slicer.git?path=Assets/Auto9Slicer

Simple Use

Create Auto9SliceTester. Assets > Create > Auto 9Slice > Tester

Screen Shot 2021-01-31 at 11 25 46

Click Run to automatically slice the images in the same directory.

Screen Shot 2021-01-31 at 11 27 20

From Script

Add it to your EditorScript so that it will be executed at your desired timing.

var slicedTexture = Auto9Slicer.Slicer.Slice(texture, SliceOptions.Default);
textureImporter.spriteBorder = slicedTexture.Border.ToVector4();
File.WriteAllBytes(filePath, slicedTexture.Texture.EncodeToPNG());

Requirements

  • Requires Unity2019.4 or later

License

MIT License (see LICENSE)

About

Auto 9 slice sprite generator on Unity

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published