We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
写了一个探照灯效果,可是有些问题,望指教! 在快速移动dragView 的时候,graphics无法严丝合缝 测试demo
var stageWidth = innerWidth; var stageHeight = innerHeight; var stage = new Hilo.Stage({ container:document.body, width:stageWidth, height:stageHeight, renderType:'canvas' }); stage.enableDOMEvent([Hilo.event.POINTER_START, Hilo.event.POINTER_MOVE, Hilo.event.POINTER_END]); var ticker = new Hilo.Ticker(60); ticker.addTick(stage); ticker.start(); var img = 'http://bxu2713410132.my3w.com/bg.jpg'; var bg = new Hilo.Bitmap({ x: 0, y: 0, image: img, width: stageWidth, height: stageHeight, }); var maskBg = new Hilo.View({ x: 0, y: 0, width: stageWidth, height: stageHeight, background: '#000', alpha: .75, }); var graphics = new Hilo.Graphics({ x: 10+25, y: 10+25, }); graphics.beginFill("#000").drawCircle(0, 0, 100 >> 1).endFill(); var bg1 = new Hilo.Bitmap({ x: 0, y: 0, width: stageWidth, height: stageHeight, image: img, mask: graphics }); var dragView = new Hilo.Bitmap({ x:10, y:10, width:150, height:150, image:'http://bxu2713410132.my3w.com/drag.png' }); Hilo.util.copy(dragView, Hilo.drag); dragView.startDrag([0, 0, stageWidth, stageHeight]); dragView.on("dragStart", function(e) {
graphics.x = e.target.x + 25; graphics.y = e.target.y + 25;
}); dragView.on("dragMove", function(e) { graphics.x = e.target.x + 25; graphics.y = e.target.y + 25; }); dragView.on("dragEnd", function(e) { graphics.x = e.target.x + 25; graphics.y = e.target.y + 25; }); setTimeout(function(){ dragView.stopDrag(); },5000); stage.addChild(bg,maskBg,bg1,dragView);
The text was updated successfully, but these errors were encountered:
fix: dragMove event should be sent at the end, fix #92
7b06664
7b3341e
这个是因为先发了dragMove事件后再改变位置导致的,已修复。
Sorry, something went wrong.
No branches or pull requests
写了一个探照灯效果,可是有些问题,望指教!
![image](https://user-images.githubusercontent.com/9291534/28398553-451e251e-6d3a-11e7-82cb-11c6cdac97f9.png)
在快速移动dragView 的时候,graphics无法严丝合缝
测试demo
var stageWidth = innerWidth;
var stageHeight = innerHeight;
var stage = new Hilo.Stage({
container:document.body,
width:stageWidth,
height:stageHeight,
renderType:'canvas'
});
stage.enableDOMEvent([Hilo.event.POINTER_START, Hilo.event.POINTER_MOVE, Hilo.event.POINTER_END]);
var ticker = new Hilo.Ticker(60);
ticker.addTick(stage);
ticker.start();
var img = 'http://bxu2713410132.my3w.com/bg.jpg';
var bg = new Hilo.Bitmap({
x: 0,
y: 0,
image: img,
width: stageWidth,
height: stageHeight,
});
var maskBg = new Hilo.View({
x: 0,
y: 0,
width: stageWidth,
height: stageHeight,
background: '#000',
alpha: .75,
});
var graphics = new Hilo.Graphics({
x: 10+25,
y: 10+25,
});
graphics.beginFill("#000").drawCircle(0, 0, 100 >> 1).endFill();
var bg1 = new Hilo.Bitmap({
x: 0,
y: 0,
width: stageWidth,
height: stageHeight,
image: img,
mask: graphics
});
var dragView = new Hilo.Bitmap({
x:10,
y:10,
width:150,
height:150,
image:'http://bxu2713410132.my3w.com/drag.png'
});
Hilo.util.copy(dragView, Hilo.drag);
dragView.startDrag([0, 0, stageWidth, stageHeight]);
dragView.on("dragStart", function(e) {
});
dragView.on("dragMove", function(e) {
graphics.x = e.target.x + 25;
graphics.y = e.target.y + 25;
});
dragView.on("dragEnd", function(e) {
graphics.x = e.target.x + 25;
graphics.y = e.target.y + 25;
});
setTimeout(function(){
dragView.stopDrag();
},5000);
stage.addChild(bg,maskBg,bg1,dragView);
The text was updated successfully, but these errors were encountered: