How to: Basesheet hover

Apr 15, 2014 at 5:48 PM

My question is about hover event for basesheets (like in crossyards).

I want to change the image for that basesheet when hover the mouse... how can I do that?

And the other question is... how can I change the basesheet image easily?

Apr 15, 2014 at 7:52 PM
For setting image of basesheet, read this discussion:

Hovering basesheet: in Crossyards it works different, because no canvas is involved there. It is just image tiles generated on the server and a simple transparent image with a quadrilateral drawing is hovered over the top. With sheetengine you could play with the "selecting locations and objects" demo to see how mouse coordinates are transformed to screen coordinates, and there is also a helper function in sheetengine:
sheetengine.calc.checkInboundsPolygon(corners, u, v)
where you need to supply an array of points with u-v coordinates and a 'u' and a 'v' value to check if the point defined by these u-v values fall into the quadrilateral defined by the corners, or not. Return value is an object, whose "inbounds" boolean property holds the result of this check.
To supply data of a basesheet you can use the cornersuv property of a basesheet:
So something like the following:
var mouseu = .. // use selecting objects demo to find this value
var mousev = ..
for (var i=0;i<sheetengine.basesheets.length;i++) {
  var bs = sheetengine.basesheets[i];
  if (sheetengine.calc.checkInboundsPolygon(, mouseu, mousev).inbounds)
    alert('basesheet is hovered');
May 17, 2014 at 12:07 AM
I post my solution here It shows white border around basesheet.