Home › Forums › Bug Reports and Feature Requests › Click event but not on drag action
- This topic has 14 replies, 2 voices, and was last updated 1 year, 2 months ago by Fabulous FOUR.
-
AuthorPosts
-
2023-08-30 at 10:23 am #66466Fabulous FOURCustomer
Hi,
Is it possible to distinguish between 2 events, Drag and Click?
Le’s take the spinner demo: https://cdn.soft8soft.com/demo/blender/spinner/spinner.html
If i drag but my starting drag location on the screen is on a color bubble, it will also click on the bubble.
I just want to drag, not to click.
If I want to click, I click on the bubble without dragging.
There is no “Exclude Drag” on the click event. Or maybe there is another solution?
Thanks.Attachments:
You must be logged in to view attached files.2023-08-30 at 11:14 am #66473kdvParticipantThose puzzle both require clicking but in a different way
That’s how you can get rid of
when clicked
and usewhen dragged over
both for dragging and clickingPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-30 at 12:10 pm #66481Fabulous FOURCustomerI’m looking at your solution and come back to you, thanks
- This reply was modified 1 year, 2 months ago by Fabulous FOUR.
- This reply was modified 1 year, 2 months ago by Fabulous FOUR.
2023-08-30 at 12:12 pm #66484kdvParticipantFor one ball
For all balls
https://v3d.net/ndaPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-30 at 12:57 pm #66488Fabulous FOURCustomerThanks! Now there is no click event when start dragging! And I can manage the click nicelly. Really useful tip!
I’ve tried to keep the camera panning on the “move: do” but I can’t reach this result. Any idea ?
ps. I don’t have the “dragged object” puzzle nor the option on “drag move” puzzle. Why?
2023-08-30 at 1:04 pm #66489kdvParticipantI’ve tried to keep the camera panning on the “move: do” but I can’t reach this result. Any idea ?
The camera controls are intentionally disabled when you try to drag some object.
You can enable the camera controls back but the result will be opposite to what you are expecting.
https://v3d.net/ndaI don’t have the “dragged object” puzzle
That’s from my plugin. You don’t need it.
nor the option on “drag move” puzzle.
That’s a new puzzle introduced in 4.5.0 pre1
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-30 at 1:28 pm #66493Fabulous FOURCustomerOur message are crossing ;o) I’m trying your solution…
I really appreciate the quality of your answers !
The camera controls are intentionally disabled when you try to drag some object.
So in the case of the spinner, it’s not possible to manage the click as you did and keep the camera panning?
In a game like Teapot Heater (https://cdn.soft8soft.com/demo/blender/teapot_heater/index.html), you can drag the camera with touch/click. But when you start your drag motion on a clickable objet, the click event is triggered. It is possible to avoid the click with your tip but the camera can’t be dragged then?
- This reply was modified 1 year, 2 months ago by Fabulous FOUR.
2023-08-30 at 1:32 pm #66496kdvParticipantRead above. Check up the app.
In a game like Teapot Heater
You mean you don’t want objects to be clicked when you start the camera rotation with the cursor over the objects? Use “double click/tap” for triggering.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-30 at 2:19 pm #66498Fabulous FOURCustomerSorry, certainly my english is bad. Like in Spinner or Teapot Heater the “drag” word was not for the objects, but for the action the user is doing. The drag action I talk about is : Touch/Click -> Move -> Release. I agree with you, in these games, the drag action is only panning the camera, not moving the objects.
With the Spinner game, when you’re moving the camera (Touch/Click -> Move -> Release), it’s not good to have a click triggered when your drag action starts on a clickable object. But you should be able to move the camera anyway.
I tried your solution and I confirm the click is well managed but It only moves the objet.
- This reply was modified 1 year, 2 months ago by Fabulous FOUR.
Attachments:
You must be logged in to view attached files.2023-08-30 at 2:25 pm #66499Fabulous FOURCustomerUse “double click/tap” for triggering.
That’s the solution I’m using for now, but it’s not the best one. I’m looking for an interaction I found in games like “The Room” where you can move your camera without triggering the click.
2023-08-30 at 2:29 pm #66502kdvParticipantYou’re expecting too much. How should the app understand what you are going to do if you pressed the button when the pointer is over the draggable object? Maybe you want to rotate the camera without dragging? Or the next time you want to drag without rotating? That’s why the controls are disabled when you click on draggable objects. If you enable them you will drag an object and rotate the camera at the same time.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-30 at 2:32 pm #66503Fabulous FOURCustomerThat’s the point. I don’t want to drag the object. I just want to move the camera. I wasn’t clear.
- This reply was modified 1 year, 2 months ago by Fabulous FOUR.
2023-08-30 at 2:40 pm #66505Fabulous FOURCustomerif you pressed the button when the pointer is over the draggable object? Maybe you want to rotate the camera without dragging?
if you pressed the button when the pointer is over the clickable object :
– If you move -> rotate the camera, like if you don’t press the button over the clickable object.
– If you release the button -> click2023-08-30 at 2:41 pm #66506kdvParticipantThen you shouldn’t have talked about dragging initially meaning the scene’s camera rotation )))
And it’s easy to do using
when dragged over
(when clicked
won’t do).Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-30 at 2:49 pm #66508Fabulous FOURCustomerBingo! Sorry for my bad english and well done. Thanks a lot!
-
AuthorPosts
- You must be logged in to reply to this topic.