FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(ui): add ui plugin with button management by Miou-zora · Pull Request #46 · EngineSquared/EngineSquared · GitHub

feat(ui): add ui plugin with button management - #46

Merged
Miou-zora merged 28 commits into
mainfrom
12-ui-plugin
Nov 9, 2024
Merged

feat(ui): add ui plugin with button management#46
Miou-zora merged 28 commits into
mainfrom
12-ui-plugin

Conversation

Miou-zora commented Oct 28, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

I've added a way to click on a collider and update its state (for texture). It also use given callback.

Component:

  • Button: represents a clickable entity. Said entity should have BoxCollider2D, Transform and Sprite2D to work properly

System:

  • UpdateButtonState: update Buttons states and add TemporaryComponent ES::Plugin::Tools::HasChanged<ES::Plugin::UI::Component::Button> if state have changed
  • UpdateButtonTexture: if states have changed, it will update Button's texture or color
  • ButtonClick: call onClick function attribute if button have changed from state pressed to hover

I've also added other plugins and tools:

  • HasChanged (Plugin Tools): used to tell that a component has changed (should work with temporary component)
  • Rect (Plugin Math): struct to store data of a rectange (size and pos)
  • QuaternionToEuler (Plugin Math): utility function to convert a quaternion to euler angles (used to rotate a 2DTexture)
  • Color (Plugin Colors): struct representing a color using RGBA. Contains already many default colors

Miou-zora added the enhancement New feature or request label Oct 28, 2024
Miou-zora self-assigned this Oct 28, 2024
Miou-zora linked an issue Oct 28, 2024 that may be closed by this pull request
Miou-zora marked this pull request as ready for review October 29, 2024 02:01
Miou-zora requested a review from a team October 31, 2024 11:57
Miou-zora requested review from a team and removed request for a team November 6, 2024 03:09
Miou-zora merged commit bd4cc10 into main Nov 9, 2024
Miou-zora deleted the 12-ui-plugin branch November 9, 2024 07:56
MasterLaplace pushed a commit that referenced this pull request Dec 6, 2024
I've added a way to click on a collider and update its state (for
texture). It also use given callback.

Component:
- `Button`: represents a clickable entity. Said entity should have
`BoxCollider2D`, `Transform` and `Sprite2D` to work properly

System:
- `UpdateButtonState`: update `Button`s states and add
TemporaryComponent
`ES::Plugin::Tools::HasChanged<ES::Plugin::UI::Component::Button>` if
state have changed
- `UpdateButtonTexture`: if states have changed, it will update
`Button`'s texture or color
- `ButtonClick`: call `onClick` function attribute if button have
changed from state pressed to hover

I've also added other plugins and tools:

- `HasChanged` (Plugin `Tools`): used to tell that a component has
changed (should work with temporary component)
- `Rect` (Plugin `Math`): struct to store data of a rectange (size and
pos)
- `QuaternionToEuler` (Plugin `Math`): utility function to convert a
quaternion to euler angles (used to rotate a 2DTexture)
- `Color` (Plugin `Colors`): struct representing a color using RGBA.
Contains already many default colors

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
MasterLaplace pushed a commit that referenced this pull request Dec 6, 2024
I've added a way to click on a collider and update its state (for
texture). It also use given callback.

Component:
- `Button`: represents a clickable entity. Said entity should have
`BoxCollider2D`, `Transform` and `Sprite2D` to work properly

System:
- `UpdateButtonState`: update `Button`s states and add
TemporaryComponent
`ES::Plugin::Tools::HasChanged<ES::Plugin::UI::Component::Button>` if
state have changed
- `UpdateButtonTexture`: if states have changed, it will update
`Button`'s texture or color
- `ButtonClick`: call `onClick` function attribute if button have
changed from state pressed to hover

I've also added other plugins and tools:

- `HasChanged` (Plugin `Tools`): used to tell that a component has
changed (should work with temporary component)
- `Rect` (Plugin `Math`): struct to store data of a rectange (size and
pos)
- `QuaternionToEuler` (Plugin `Math`): utility function to convert a
quaternion to euler angles (used to rotate a 2DTexture)
- `Color` (Plugin `Colors`): struct representing a color using RGBA.
Contains already many default colors

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
MasterLaplace pushed a commit that referenced this pull request Dec 6, 2024
I've added a way to click on a collider and update its state (for
texture). It also use given callback.

Component:
- `Button`: represents a clickable entity. Said entity should have
`BoxCollider2D`, `Transform` and `Sprite2D` to work properly

System:
- `UpdateButtonState`: update `Button`s states and add
TemporaryComponent
`ES::Plugin::Tools::HasChanged<ES::Plugin::UI::Component::Button>` if
state have changed
- `UpdateButtonTexture`: if states have changed, it will update
`Button`'s texture or color
- `ButtonClick`: call `onClick` function attribute if button have
changed from state pressed to hover

I've also added other plugins and tools:

- `HasChanged` (Plugin `Tools`): used to tell that a component has
changed (should work with temporary component)
- `Rect` (Plugin `Math`): struct to store data of a rectange (size and
pos)
- `QuaternionToEuler` (Plugin `Math`): utility function to convert a
quaternion to euler angles (used to rotate a 2DTexture)
- `Color` (Plugin `Colors`): struct representing a color using RGBA.
Contains already many default colors

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Plugin

2 participants


Back | FazBrowse Home | New Git URL