Skip to content

improve texture slicing; support non-symmetrical slicing#13488

Closed
JJJimbo1 wants to merge 2 commits intobevyengine:mainfrom
JJJimbo1:main
Closed

improve texture slicing; support non-symmetrical slicing#13488
JJJimbo1 wants to merge 2 commits intobevyengine:mainfrom
JJJimbo1:main

Conversation

@JJJimbo1
Copy link
Contributor

@JJJimbo1 JJJimbo1 commented May 23, 2024

Objective

Previously, it was impossible to use a texture slicer when the 'center' was not in the exact center of the source image. This PR aims to fix that.

Solution

Changed the slicing algorithm to allow for non-symmetrical slicing.
Code cleanup.
Adjusted the relevant example to show that it's possible.
Fixed some bugs.

Before:
non-symmetrical_texture_slice_before

After:
non-symmetrical_texture_slice

Testing

I tested these changes using the ui_texture_slice example. As far as my testing goes, it works as intended, but it is possible I missed some weird edge case.


Changelog

Changed the texture slicing algorithm.
Changed the ui_texture_slice example.
Added panel-border-020.png asset to showcase the changes.

@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 23, 2024
@JJJimbo1 JJJimbo1 closed this Jun 19, 2024
@rparrett
Copy link
Contributor

Assuming this was closed because #13921 fixed the issue?

@JJJimbo1
Copy link
Contributor Author

Yes.

@rparrett
Copy link
Contributor

rparrett commented Jun 19, 2024

Cool, thanks. Sorry this one seemingly got lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants