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

few questions #13

Open
callagga opened this issue Jan 12, 2021 · 4 comments
Open

few questions #13

callagga opened this issue Jan 12, 2021 · 4 comments

Comments

@callagga
Copy link

(few questions - not sure if this is correct place to ask)

New to Flutter & come across this package. In terms of doing a small 2D point & click apps, that has a backage image, with clickable polygons aligned with the image over key objects in the image, say running landscape, but can rescale to handle different devices:

Q1 - Is the Flutter Canvas the only way of doing this in flutter, and this package assists? i.e. or is there an alternative to having to use canvas / Custom Painter? (e.g. only using an image flutter widget)

Q2 - I'm noticing when I run on IOS simulator with a Rect and Circle overlapping I'm not getting consistent results with touchable (e.g. onTapDown) and it seems to be missing capturing some clicks? Any known issues with reliability here? Or is this likely to be related to using the simulator?

Q3 - Would the module support scaling across different devices ok?

Q4 - (an aside) - happen to know a tool that would one create a polygon over an image, then export the data in the right format to copy/paste into a flutter app to be used to create a polygon on the canvas? (then use touchable to detect taps in this area)

tks

@callagga
Copy link
Author

have made some progress reading/testing - my understanding now would be:
Q1 - CustomPainter (canvas) seems to be the only way
Q2 - working ok (may have misunderstood / mis-setup original test apps)
Q3 - using the following parents seems to do the trick from what my testing has show (see code below).
Q4 - well this was just an aside...still interested.

Any comments? Can close otherwise...

@override
  Widget build(BuildContext context) {
    const double logicalWidth = 1920;
    const double logicalHeight = 1080;
    return FittedBox(
        child: SizedBox(
            width: logicalWidth,
            height: logicalHeight,
            child: GameMain(),   // implements custompainter here
        )
    );
  }

@jaredpexton
Copy link

@callagga For Q2, what was the setup that you missed? I'm having the same issue.

@callagga
Copy link
Author

I must admit I haven't looked at this since and really can't remember sorry

@xerotolerant
Copy link

I'm having a similar issue but without overlapping. I think there might be a bug because the bottom right of all circles do not register click events on macOS

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

No branches or pull requests

3 participants