Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 9-slice support for Images #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kulltero
Copy link
Contributor

Slicing Serverside images

This PR only adds the ability to specify the border, not the Tilemode or Stretch properties Learn more about 9-slicing

The Breakdown

this PR allows us to specify a Slice property on the UnityEngine.UI.Image object to change how the image is displayed. paired with the existing imagetype field this lets us easily create borders, corner images and glows that scale to any size with just a single asset

Notes:

when setting a slice value it can only be done during instantiation, so any sprites using a slice value will not be cached. it could be reasonable to assume that a sprite will only ever be used with a single slice value (and therefore be cached), but the PR cannot make this assumption at the cost of breaking potential usecases where this isn't the case.

adjusted the methods for loading server images to support a slice parameter (which will set the Sprite.border value). sprites using a slice will not be cached
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant