khaninD

Members
  • Content Count

    10
  • Joined

  • Last visited

  1. i write this example, based on your comments, but i can't understand, how to shorten line, how this link
  2. app.renderer.plugins.interaction.on('touchstart', (e) => { const {data: {global: {x, y}}} = e; this.startPoint = {x, y}; }); app.renderer.plugins.interaction.on('touchend', (e) => { let i = 0; setInterval(() => { this.lines[i].clear(); i++ }, 400); this.dataMove = []; }); app.renderer.plugins.interaction.on('touchmove', (e) => { const {data: {global: {x, y}}} = e; const line = new PIXI.Graphics(); line.lineStyle(3, 'red'); this.lines.push(line); app.stage.addChild(line); this.dataMove.push({x, y}); this.anim(line); }); anim(line) { const {x, y} = this.startPoint; line.moveTo(x, y); this.dataMove.forEach((item, index) => { line.lineTo(item.x, item.y) }); } this code draw line... on event `touchend` i want clear line in interval, but it's not working, line clear all after long time...
  3. app.renderer.plugins.interaction.on("mousemove", (e) => { const {x, y} = e.data.global; const rectangle = u.sprite(3, 3, 'red', x, y); app.stage.addChild(rectangle); }); i write this code for check the performance, but with a quick mouse movement, the dots do not appear everywhere, or do not you need to use a rectangle? have to use bezierCurveTo ?
  4. Hi, how can I implement a line moving behind the cursor like this link
  5. Hi, in my project i use pixi-charm and pixi-filters, and i get this exception TypeError: Cannot redefine property: isJson without pixi-charm, all right...
  6. const width = window.innerWidth; const height = window.innerHeight; const imgWidth = 3500; const imgHeight = 1589; const app = new PIXI.Application( { width, height, transparent: true } ); const u = new SpriteUtilities(PIXI); const bg = u.tilingSprite("./src/bg.png", imgWidth, imgHeight); imageScale({imgWidth, imgHeight}, bg); app.stage.addChild(bg); app.ticker.add(parallaxFn); document.getElementById('app').appendChild(app.view); function parallaxFn() { bg.tilePosition.x -= 5; } function imageScale({imgWidth, imgHeight}, sprite) { const widthRatio = width / imgWidth; const heightRation = height / imgHeight; sprite.scale.x = widthRatio; sprite.scale.y = heightRation; } i use https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.5.1/pixi.min.js And I have (see image file) after one minute, this only on mobile
  7. Ivan, thank you for answer. Later, I'll post the code using the new version of pixi, and a link to the app so you can see for yourself
  8. Hi, Why parallax scroller very much brakes on the phone (samsung a3 2016), in 2 - 3 minutes after the application launch?