Action move the mouse


(Gustavo) #1

Hi! I’m creating my website with Hype and I need some help to figure out how can I animate some objects in the scene with the mouse movement.
For example, I have a scenario in the background with elements distributed in the layers of the timeline.When I move the mouse to the left I would like that the objects move to the right, at different speeds. I need to make it looks like 3D, with depth in the scene.
Hope to hear from you soon!
Best Regards,
Guto


#2

HI Gustavo @guto

For this you would need to set up your timelines with the animation you want. Then create some javascript to track the mouse movement and call the startTimlimeNamed() function so that the animation will play as your mouse moves. (perhaps you could create a way of moving the timeline as your mouse moves rather than play it but that is pretty technical and I don’t know how well you understand Javascript)

D


(Gustavo) #3

I know nothing about Java, but I can understand that your suggestion seems to be better . Use the timeline and not the object.

I’m doing a really cool project in Hype , when I can just show . Not knowing much of Java have limitations.

Thank you for answers and the team Tumult Hype can help me would be very grateful .

thank you


(Greg) #4

Personally, I’d not use a mouse movement to activate the animation because the end user would be moving the mouse and that may cause a lot of confusion as each move would trigger it. Maybe a mouse over, click, or touch would be better in this case. Here’s a sample with a mouse down action to move two elements at different speeds. (no javascript, just timelines)

movers.hype.zip (12.4 KB)


(Gustavo) #5

Hello Greg , thank you for helping me. Cool the file you sent me . But I am sure of what I need . I will try to explain better :

I’m in a scene three objects that make up a scenario : a tree, an animal and a mountain in the background.

If I can do this objects move very little when the User move the mouse left or right will be a reality in the scene. I do it a lot when I need to make a video appearance by using images. A parallax effect.

I do not write English well , sorry .

Again thank you if you can help me.

Good night (I’m in Brazil … lol )


(Greg) #6

Here’s another demo with a javascript to detect the mouse movement. But as you’ll see, any mouse movement will relaunch the timeline animation. If that’s OK, then this may work for you.

get_mouse_direction-1.hype.zip (10.2 KB)


(Gustavo) #7

Hello , after searching all night I found a perfect example of what I need . A please look at :

http://www.onextrapixel.com/examples/interactive-background/index.html

It will be perfect for the idea of ​​the site . Of to make this effect?
If so, can continue to help me and do a favor for example.

thank you


(Gustavo) #8

I just think in the forum what I wanted :