Git Product home page Git Product logo

scalenineslicer's Introduction

Scale Nine Slicer

A tool for automating work with 9 slice scaling in Unity.

Automatic 9 slice borders detection.

Autodetection!

Trimming sliced sprite center to 1px.

Trim center!

Trimming extra transparency.

Trim alpha!

Installation

There are 3 ways to install this plugin:

  • clone/download this repository and move the Plugins folder to your Unity project's Assets folder
  • (via Package Manager) add the following line to Packages/manifest.json:
  • (via OpenUPM) after installing openupm-cli, run the following command:
    • openupm add com.utkaka.scale-nine-slicer

Usage:

Context menu in Project view

You can select textures and/or folders with sprites and perform an action on all contained sprites.

Context menu!

Editor window (Unity 2021.2+)

If you want a more controlled result there is an editor window (Window/2D/Sprite Nine Slicer).

Editor window!

Features:

  • Works with multiple selection.
  • Manual borders setting. You can zoom with ctrl/cmd key pressed and set borders via input fields or draggable lines on the image.
  • You can enable or disable trimmings.
  • You can preview the result, extend it to see how it works. Also you can export extended sprite to png.

API

Just create an instance of SpriteInfo and use it's public API. You can use it both in Unity Editor and at runtime.

scalenineslicer's People

Contributors

utkaka avatar semantic-release-bot avatar

Stargazers

Mr.Hu avatar Farley Drunk avatar youchienji avatar End3r6 avatar Vladislav Kantaev avatar  avatar Alex Silaev avatar Jim Chan avatar well.james avatar Sheh伟伟 avatar Jean-Philippe Deblonde avatar Jeff Carpenter avatar Andy Baker avatar li5414 avatar Ali Şahan Yalçın avatar HHHHHHHHHHHHHHHHHHHHHCS avatar luzhou avatar Ivan Murzak avatar minerBCD avatar  avatar  avatar  avatar Shawn Cleverdon avatar zyzyx avatar fumiko avatar Laicasaane avatar

Watchers

 avatar Sheh伟伟 avatar

scalenineslicer's Issues

Can't be imported by OpenUPM

I have mathematics 1.2.6 in my project. Looks like it required 1.0.0 and can't accept newer versions

openupm add com.utkaka.scale-nine-slicer
WARN 404 package [email protected] is not a valid choice of 0.0.12-preview.2, 0.0.12-preview.5, 0.0.12-preview.8, 0.0.12-preview.10, 0.0.12-preview.11, 0.0.12-preview.13, 0.0.12-preview.17, 0.0.12-preview.19, 0.0.12-preview.20, 1.0.0-preview.1, 1.0.1, 1.1.0-preview.1, 1.1.0, 1.2.1, 1.2.4, 1.2.5, 1.2.6, 1.3.1
notice suggest to install [email protected] or a replaceable version manually
ERR! missing dependencies please resolve thie issue or run with option -f to ignore the warning

Issues after importing the package into a project

Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Uxml/SlicePreview.uxml (line 4): warning: Asset reference to GUID '85f4ca9a37a3147b98a30d7305952ce7' was moved from 'Assets/SpriteNineSlice/Assets/Sprites/checker.png' to 'Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Sprites/checker.png'. Update the URL 'project://database/Assets/SpriteNineSlice/Assets/Sprites/checker.png?fileID=21300000&guid=85f4ca9a37a3147b98a30d7305952ce7&type=3#checker' to remove this warning.
Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Uxml/BordersEditor.uxml (line 4): warning: Asset reference to GUID '85f4ca9a37a3147b98a30d7305952ce7' was moved from 'Assets/SpriteNineSlice/Assets/Sprites/checker.png' to 'Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Sprites/checker.png'. Update the URL 'project://database/Assets/SpriteNineSlice/Assets/Sprites/checker.png?fileID=21300000&guid=85f4ca9a37a3147b98a30d7305952ce7&type=3#checker' to remove this warning.
Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Uxml/SlicePreview.uxml: Semantic - USS in 'style' attribute is invalid: Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Uxml/SlicePreview.uxml (line 4): warning: Asset reference to GUID '85f4ca9a37a3147b98a30d7305952ce7' was moved from 'Assets/SpriteNineSlice/Assets/Sprites/checker.png' to 'Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Sprites/checker.png'. Update the URL 'project://database/Assets/SpriteNineSlice/Assets/Sprites/checker.png?fileID=21300000&guid=85f4ca9a37a3147b98a30d7305952ce7&type=3#checker' to remove this warning.
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets (string[],string[],string[],string[],string[],bool)
Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Uxml/BordersEditor.uxml: Semantic - USS in 'style' attribute is invalid: Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Uxml/BordersEditor.uxml (line 4): warning: Asset reference to GUID '85f4ca9a37a3147b98a30d7305952ce7' was moved from 'Assets/SpriteNineSlice/Assets/Sprites/checker.png' to 'Packages/com.utkaka.scale-nine-slicer/Editor/Window/Assets/Sprites/checker.png'. Update the URL 'project://database/Assets/SpriteNineSlice/Assets/Sprites/checker.png?fileID=21300000&guid=85f4ca9a37a3147b98a30d7305952ce7&type=3#checker' to remove this warning.
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets (string[],string[],string[],string[],string[],bool)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.