Game Development Reference
In-Depth Information
zero being a completely transparent—invisible—element and one being completely
rendered).
var width = _touches[i].webkitRadiusX * 20;
var height = _touches[i].webkitRadiusY * 20;
var force = _touches[i].webkitForce;
var touch = document.createElement("div");
touch.style.width = width + "px";
touch.style.height = height + "px";
touch.style.left = (_touches[i].pageX - width /
2) + "px";
touch.style.top = (_touches[i].pageY - height /
2) + "px";
touch.style.opacity = force;
touches.push(touch);
target
When a touch event is detected, the DOM element, where the touch was first detec-
ted, is referenced through the target attribute. Since a touch object is tracked until
the touch ends, the target attribute will reference the original DOM element where
the touch was first started for the duration of the touch life cycle.
Search WWH ::




Custom Search