onTapDown callback does not work. #3803
-
|
Good day, I am a beginner with flame and flutter in general too. I just wanted to try the flame engine out. And I have been trying to us BLOC with it with the flame_bloc package. I have been trying to get a callback from a tap for quite a while now but I am completely lost. I do not have enough flutter and dart knowledge to find the answer myself too. And the documentation is not entirely clear for me. I have been using AI too most of the time to understand what is going on and how to do things but even that is not really helpful. So I request for your help to find out what I am doing wrong or where I am lacking. Thank you in advance. Here is my main: Here is my game: Here is my world: Here is my ball script: And lastly the game bloc: I apologize if I opened this discussion in a wrong way. I am really lost and I do not know what to do anymore. I do now know even if I have setup the bloc properly. Again. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Not an answer to your question, but are you sure that you need |
Beta Was this translation helpful? Give feedback.
-
|
I ran into the same issue where In my case, the problem turned out to be related to how I was assigning the Initially I had: Ball(position: Vector2(100, 100))
..decorator = PaintDecorator.tint(
const Color.fromARGB(180, 219, 120, 21),
);After changing it to: Ball(position: Vector2(100, 100))
..decorator.addLast(
PaintDecorator.tint(
const Color.fromARGB(180, 219, 120, 21),
),
);
Notes
SummaryIf
This resolved the issue in my case. |
Beta Was this translation helpful? Give feedback.
I ran into the same issue where
onTapDownwas not triggering, even though everything seemed set up correctly.In my case, the problem turned out to be related to how I was assigning the
decorator.Initially I had:
After changing it to:
onTapDownstarted working as expected.Notes
TapCallbackswas added and the component had a defined sizedecoratorinterferes with the co…