unity-technologies / 2d-spriteshape-samples Goto Github PK
View Code? Open in Web Editor NEWSamples for the 2D SpriteShape feature.
Samples for the 2D SpriteShape feature.
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.
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.
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:
This is the tileset-texture, slices, and texture-settings I'm using:
======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:
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:
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).
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.
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.
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.
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.
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?
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;
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!
So I have a grid full of smaller (9-slice) "tile" graphics that I want to use. They look something like this:
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.
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):
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):
There doesn't seem to be a way to access the "Color" property of the SpriteShapeRenderer via script (although it is settable via editor and is serialised).
We'd like to use this for dynamic construction of SpriteShape objects.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.