Giter VIP home page Giter VIP logo

2d-spriteshape-samples's Introduction

2d-spriteshape-samples

This repository contains samples of the 2D SpriteShape feature to be used with Unity 2018.1b10 and newer.

Getting Started

Get the Unity Editor

To get started, download and install the latest Unity 2018.1, here: https://unity3d.com/get-unity/download

Get the Package

These samples include the necessary manifest in the Packages folder of the project, and do not require the main Package to be downloaded. If you wish to activate these Package features in another project, you may download the Package from the Package Manager.

Find out more about packages here: Unity Package Manager

Preview Feature Documentation

❗❗❗ Warning ❗❗❗

Project backward compatibility between Preview versions is NOT GUARANTEED. Always backup your project before updating the package. Preview features here are not production ready, please DO NOT use this package for your final production. Preview features may be discontinued/dropped.

2d-spriteshape-samples's People

Contributors

darrenquek avatar rus-unity avatar sam-unity avatar unitypaul avatar venkify avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2d-spriteshape-samples's Issues

Pan view while in Edit Spline mode?

I maybe missing a shortcut or something but I can't seem to be able to pan the scene view while in Edit Spline mode, when I hit Alt+LMB it just marquee select just like without Alt pressed.

Even weirder than that when I Alt+LMB over the spline the view pans just fine, but when outside it just marquee selects.

I highly doubt this is, or should be an intended behaviour.

Sprite Variant (Formerly known as Sprite Index) does not work

Problem: I have made a simple SpriteShape example and randomly assigned points of variation 0 and 1. I am using some textures with blue for 0 and red for 1.

My entire SpriteShape is blue. Even when changing everything to 1 (which should make them red), they are still blue.

Switching the red (now 0) and blue (now 1) textures between them updates the SpriteShape accordingly (everything red as if everything is 0) even when everything is set to 1....

For some reason, changing only one of the points to 1 turns all of them to the end to 1.
What is happening....

Expected behavior: Changing a Sprite Variation index would pick the texture at the specified index to render up untill the next point.

Correct version of the package?

What is the latest version the documentation shows version 4.1 but the package manager is on version 3.0.12, which is not even listed in the changelog? It's really confusing.

Change the texture offset of the fill.

I absolutely love SpriteShape. However I am racking my brains to try to work out how I can offset the UVs, which is essential to a project I'm working on. I tried creating a material with texture offset but it says that isn't supported. The only options I have are stretch UV's and worldspace uvs and they don't work for my usecase.

I think right now I'm going to need to fiddle around with the transform origins and spline points to get the uv offsets right.

I would love if there was a way to offset the fill in the spriteshapecontroller.

Tilemap Integration

Hey! Loving spriteshape so far. Works really well, other than a few small bugs (like the renderer randomly not displaying in the editor).

Would it be possible to have built in tilemap integration? I know you can technically create a brush to somehow manipulate the object, but it'd be really nice if we could just "paint" on a grid/layer and have the shape update.

SpriteShapeRenderer - separate color for Fill and Edge Material

Hello,

Is this possible to have the same material but a different color for Fill and Edge Material?

I found a workaround but maybe there's a better way to achieve this?

spriteShapeRenderer = GetComponent<SpriteShapeRenderer>(); spriteShapeRenderer.materials[0].color = Color.green; spriteShapeRenderer.materials[1].color = Color.blue;

image

Problems with UV for "normal" grid-based tiling with square sliced sprite

The texture used is aligned to the grid exactly, but it seems to not work this way. The sprite I use is a slice of a larger set of 9-slice textures:

image

This is the tileset-texture, slices, and texture-settings I'm using:

image

======EDIT======

I've played with the settings again, and apparently I forgot that "bilinear" always looks like garbage for lower-resolution sprites. However, after playing with this low-resolution stuff, I noticed that there is a "gap" between the corner parts (now that I'm using "Point" filtering mode) that wasn't apparent when using "bilinear" texture filtering:

image

image

It appears to come from the length of the previous strip being 1 "pixel" too short. You can see (if you look closely) that this affects the inside corner junction too of the top image above.

That "gap" between the tiles goes away if I change to "Medium" or "Low" Quality Detail level on the Sprite Shape Controller, but the actual number of repetitions now change between changing from "High" quality to Medium or Low Quality "detail" level:

image

Changing "Adaptive UV" or "World Space UV" doesn't help here -- it seems like the corner mesh is a completely different mesh and is slightly offset to the preceding strip that should butt up against it.

Also, PLEASE NOTE:

You'll have to zoom in nearly all the way to see this "gap" at these resolutions if you use the tileset size I provided, but it's there (as you can see in the screenshots).

Provide a sprite instead of an actual texture for FILL?

So I have a grid full of smaller (9-slice) "tile" graphics that I want to use. They look something like this:

tilea3

I'd like to "grab" the central "tile" slice (tile #5 in a 9-slice) in each group of 9-slices (because it's tileable in all 4 directions) and be able to add it as the spriteshape "fill" (instead of having to manually go crop each and every tile, make a new material, etc. etc.) The edges of the 9-slice groups I would use for the repeating borders and corners of a spriteshape, but the center of each "square" (9-slice) group is a tileable portion of the graphic because it tiles in all directions.

100% CPU usage in editor.

When I have sprite shapes in a scene in unity, then the editor starts to use 100% CPU, and I use sprite shapes everywhere in my game, all scenes. I'm using 2019.1 LTS of Unity and Sprite Shape 3.0.12.

SpriteShapeController is missing

I use Unity 2018.2.0f1
And I have this.
The type or namespace name 'SpriteShapeController' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]

It looks like this project doesn't include SpriteShapeController.
Where can I get it?

Snapping for rotation

I don't know if this is the right place for this request, but I can't get into the forums right now so I'll just post here for now. Please let me know where to post this if I'm in the wrong place.

When moving a point on a sprite shape spline you have the option to snap the points to the grid. I would love to have a checkbox for snapping tangent-handles to the grid as well. It would make it so much easier to create rounded corners that always becomes the same.

Having your points on the grid and using straight lines works somewhat but are not always ideal.

Documentation Update needed about Bevels on corners

The documentation state that there are editable bevel functionality in corners, however it was removed in early stages [1.1.0-preview.1] - 2019-02-10 stating on the release note: "Remove redundant parameters BevelCutoff and BevelSize that can be done by simply modifying source spline"

There would be a need to document the "modifying source spline" part. If it meant editing by hand all the corner by adding multiple side points, it's definitely not doing it. This feature is a crucial part of any spline tool and any pointers would greatly be appreciated.

Tuple Error

Hello, I've tried following the tutorial and using the scripts provided here, but I keep getting these two error messages for each time the springs = new(); line of code is used.

WaterShapeController.cs(21,45): error CS8124: Tuple must contain at least two elements.
WaterShapeController.cs(21,46): error CS1526: A new expression requires (), [], or {} after type

Not sure how to solve this.

Thank you!

Corner stretch looks terrible D: -- I need an "overlay" corner here!

image

As you can see, it's pretty bad.

There is a way to fix this (but I need an option to use corners as an "overlay" here (they'd essentially act as an "endcap" extension of the top platform's "corner" points):

image

Essentially, they'd have to add one more "segment" to sort of essentially "overlay" the end points of the spline there. They could be used with the automatic corner system too! -- Just add an "overlay" checkbox for each corner sprite to toggle how the corners behave.

Also, an offset (+ scaling) would be useful here (as an alternative to the nasty "stretching" on the corners):

image

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.