Click here to Skip to main content
15,881,836 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Hey There I am a graphic design student who loves Illustrator and hand letttering but must finish some coding classes to graduate. much more difficult then expected! I have a final assignment that i was hoping i might be able to get some help with. Using clientX and clientY ( or the mouseX and mouseY variables in shapes.js, an external js file that i can send to you), create a head whose eyes will follow the mouse. The body/head/eyes should be created using 2D Primitives only, and you do not need to use classes / global variables for this assignment unless you want to. eyes must be maintained along with the shape behavior shown above. I hoping I can find a tutor and or somebody who might be able to shoot me a quick template for what's might look like. needs to be a canvas element can't use java has to be made with javascript css html language


below is what the final file should look like

https://post.craigslist.org/imagepreview/00P0P_8KmWrmLUCTM_600x450.jpg

I am new to the site and the coding as a whole so I apologize for being such a newb!
Posted
Updated 1-Aug-15 5:02am
v8
Comments
Sergey Alexandrovich Kryukov 1-Aug-15 9:31am    
This is easier than cursor following your eyes. Yes, such work have been done, as one of the new revolutionary input method.

As to your question... What, no platform, language, application type, no information?

—SA
Member 11878688 1-Aug-15 10:45am    
im sorry for not clarifying! I would have to make sure i use Javascript and Css html can't use Java. It needs to be a canvas Element
Sergey Alexandrovich Kryukov 1-Aug-15 13:35pm    
Thank you for this clarification.

Right, that's enough to solve this problem. Handle the mouse move event on canvas element and do your calculations and rendering. You don't even need animation frames. What's the problem?
What have you tried so far?

—SA
jgakenhe 2-Aug-15 10:38am    
2 links should get you in the correct direction
js: http://www.javascriptkit.com/script/script2/xeye.shtml
css: http://davidwalsh.name/css-custom-cursor

The JS file is almost exactly what you need, though you'll have to rename things and move it around so you don't get caught plagiarizing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900