-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ASImageNode] Clarify documentation on why resizable images should be Stretched and not Tiled #439
Comments
Note: Changing asset image slicing from |
@Kaspik Using Stretches in your image specification is the correct fix. Even though it may look correct when you use Tiles and comment out the assertion, what is actually happening is stretching, because this is how the GPU-accelerated CALayer features operate (the stuff done by the SetResizableContents method). Ideally we'd have this better documented, but the assertion is there to help point this out. I'll leave this task open until I have a chance to improve the assertion message so it is more clear in explaining the reason why Texture requires using Stretch. To reiterate, it's because Stretch is significantly more efficient to use than Tile, and Tile can't be correctly implemented with this hardware-accelerated approach; we could certainly implement Tile, but it would use a lot more memory and CPU, whereas users can simply draw the image into a UIGraphicsContext manually to achieve this effect if it's needed. Thanks for filing this - it's a very reasonable question, and a good reminder to improve the assertion. |
@appleguy Cool, thanks for the answer! |
Fixed year ago. |
Version: Texture (2.3.3)
Repro: 100%
Problem:
If
ASImageNode
gets stretchable image:but stretching is defined in
Images.assets
viaSlicing
- then app crashes.It's not happening if code looks like:
Full setup of
ASImageNode
:Example app: ASDK button
Crash info:
bt all info:
The text was updated successfully, but these errors were encountered: