-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Allow for flippable UI Images #3225
Comments
ickshonpe
added a commit
to ickshonpe/bevy
that referenced
this issue
Oct 18, 2022
Adds the ImageFlip component. Adds an ImageFlip field called flip to UiImageBundle. Adds flip_x and flip_y fields to ExtractedUiNode. Changes extract_uinodes to extract the ImageFlip component values. Changes prepare_uinodes to swap the UV coords depending on the values of the ExtractedUiNode's flip_x and flip_y fields.
bors bot
pushed a commit
that referenced
this issue
Nov 14, 2022
# Objective Fixes #3225, Allow for flippable UI Images ## Solution Add flip_x and flip_y fields to UiImage, and swap the UV coordinates accordingly in ui_prepare_nodes. ## Changelog * Changes UiImage to a struct with texture, flip_x, and flip_y fields. * Adds flip_x and flip_y fields to ExtractedUiNode. * Changes extract_uinodes to extract the flip_x and flip_y values from UiImage. * Changes prepare_uinodes to swap the UV coordinates as required. * Changes UiImage derefs to texture field accesses.
taiyoungjang
pushed a commit
to taiyoungjang/bevy
that referenced
this issue
Dec 15, 2022
# Objective Fixes bevyengine#3225, Allow for flippable UI Images ## Solution Add flip_x and flip_y fields to UiImage, and swap the UV coordinates accordingly in ui_prepare_nodes. ## Changelog * Changes UiImage to a struct with texture, flip_x, and flip_y fields. * Adds flip_x and flip_y fields to ExtractedUiNode. * Changes extract_uinodes to extract the flip_x and flip_y values from UiImage. * Changes prepare_uinodes to swap the UV coordinates as required. * Changes UiImage derefs to texture field accesses.
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
# Objective Fixes bevyengine#3225, Allow for flippable UI Images ## Solution Add flip_x and flip_y fields to UiImage, and swap the UV coordinates accordingly in ui_prepare_nodes. ## Changelog * Changes UiImage to a struct with texture, flip_x, and flip_y fields. * Adds flip_x and flip_y fields to ExtractedUiNode. * Changes extract_uinodes to extract the flip_x and flip_y values from UiImage. * Changes prepare_uinodes to swap the UV coordinates as required. * Changes UiImage derefs to texture field accesses.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective Fixes bevyengine#3225, Allow for flippable UI Images ## Solution Add flip_x and flip_y fields to UiImage, and swap the UV coordinates accordingly in ui_prepare_nodes. ## Changelog * Changes UiImage to a struct with texture, flip_x, and flip_y fields. * Adds flip_x and flip_y fields to ExtractedUiNode. * Changes extract_uinodes to extract the flip_x and flip_y values from UiImage. * Changes prepare_uinodes to swap the UV coordinates as required. * Changes UiImage derefs to texture field accesses.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this solve or what need does it fill?
General UI functionality. In my case, some of the textures that appear in the world also need to be shown into the UI (in a Minecraft-esque tile picker that includes flipped tiles), using
ImageBundle
. I imagine others may run into similar issues.What solution would you like?
Allow
Sprite
components (which includeflip_x
andflip_y
fields) to affect UI images created fromImageBundle
. Theresize_mode
field will perhaps also be useful, if that functionality is not already covered for UI. I don't imagine thesize
field will be as relevant in UI though, but I may be wrong.What alternative(s) have you considered?
Allow sprites to be flipped with negative
Transform
scale values. Currently, they scale properly for positive values, but disappear for negative values. This is less intuitive for developers newer to gamedev, but will make particular scenarios easier to code, such as lerping to a flipped state from an un-flipped one through scaling. I don't think it should be the blessed way, though, unless they specifically need scaling and flipping to be closely related.Thank you!
The text was updated successfully, but these errors were encountered: