cbrwizard / picswars.io

Project-only repo for a browser game PicsWars.io
http://picswars.io/?ref=github
2 stars 0 forks source link

Rewrite hovering #95

Closed cbrwizard closed 7 years ago

cbrwizard commented 7 years ago

Instead, add user nicks' labels on top of their territories. Also add shiny borders to their territories as a whole.

cbrwizard commented 7 years ago

Theory on how to approach labels: might need to create a group for every player with squares; add a label on the centers of these groups.

Next, need to somehow add the borders. A theory here is that we should iterate every square and ask how bordered it should be and draw borders depending on that. That might require a lot of calculations...

cbrwizard commented 7 years ago

A much simpler approach: remove the hover info; on hover dispatch the same action; when some data is in state: display it in a div which always follows the cursor and which is visible only when it has data.

cbrwizard commented 7 years ago

Also try dispatching hover/unhover events only when data is different

cbrwizard commented 7 years ago

Done. Could be done better, but but