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

feat: Adding x,y,width and height inputs to position components on Dev Tools #3263

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

erickzanardo
Copy link
Member

Description

Adds fields to allow developers to change the x, y, width and height of position components from the dev tools.

position_2.mp4

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@erickzanardo erickzanardo requested a review from a team August 10, 2024 22:25
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no polling for the attributes if they change within the game currently right? Just check if I missed that, or if it's maybe planned as a follow-up? :)

packages/flame/lib/src/devtools/dev_tools_connector.dart Outdated Show resolved Hide resolved
packages/flame_devtools/lib/repository.dart Show resolved Hide resolved
import 'package:flame_devtools/widgets/incremental_number_form_field.dart';
import 'package:flutter/material.dart';

class PositionComponentAttributesForm extends StatefulWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class PositionComponentAttributesForm extends StatefulWidget {
class PositionComponentAttributesForm extends ConsumerWidget {

@erickzanardo
Copy link
Member Author

There is no polling for the attributes if they change within the game currently right? Just check if I missed that, or if it's maybe planned as a follow-up? :)

I did not implemented that indeed, tbh, that didn't even crossed my mind hahha, I guess my creativity is not what it used to be...

It is a good idea though! Should we make a refresh button like the component tree or just go straight into a pooling???

@spydon
Copy link
Member

spydon commented Aug 10, 2024

It is a good idea though! Should we make a refresh button like the component tree or just go straight into a pooling???

I think polling would be more user friendly, but maybe problematic when the user wants to set the values of something that is moving/resizing... Maybe just not updating the values while the user is in the text field.

@ufrshubham
Copy link
Member

ufrshubham commented Aug 11, 2024

@erickzanardo will it be possible to add some titles to the properties? Like Transform, Position, Size, something like this:
image

@erickzanardo
Copy link
Member Author

@erickzanardo will it be possible to add some titles to the properties? Like Transform, Position, Size, something like this: image

Changed to look like this:

Captura de Tela 2024-08-11 às 21 07 09

@erickzanardo erickzanardo requested a review from spydon August 12, 2024 00:07
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!!

@erickzanardo erickzanardo enabled auto-merge (squash) August 12, 2024 00:13
@erickzanardo erickzanardo merged commit 003ec3a into main Aug 12, 2024
8 checks passed
@erickzanardo erickzanardo deleted the feat/position-attributes-devtools branch August 12, 2024 00:14
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.

3 participants