Open ziarmandhost opened 3 years ago
Can you provide a simple code example of this issue?
Can you provide a simple code example of this issue?
Call:
Core.Graphics.viewport.follow(Core.Graphics.camera, {speed: 0.25});
Core.Graphics (where i create camera): `Graphics.app = new PIXI.Application({ width: window.innerWidth, height: window.innerHeight, resizeTo: window, autoresize: true, transparent: true }); document.body.appendChild(Graphics.app.view);
Graphics.viewport = new Viewport({
screenWidth: window.innerWidth,
screenHeight: window.innerHeight,
stopPropagation: true,
disableOnContextMenu: true,
interaction: Graphics.app.renderer.plugins.interaction
});
Graphics.app.stage.addChild(Graphics.viewport);
this.setupCulling();
Graphics.configure();
Graphics.camera = new PIXI.DisplayObject();`
Configure: `static configure() { Graphics.app.stage.interactive = true;
Graphics.viewport
.drag()
.pinch()
.wheel()
.decelerate()
Graphics.viewport.position.x = window.innerWidth / 2;
Graphics.viewport.position.y = window.innerHeight / 2;
Graphics.viewport.scale.x = Graphics.zoom;
Graphics.viewport.scale.y = Graphics.zoom;
}`
That's actually all things
This looks correct. Where's your follow command?
This looks correct. Where's your follow command?
Its my onLoaded listener. I call this listener when all resources loaded, just in that case
maybe pixi-culling make it bugged?
I'm not sure how pixi-cull would impact the follow. All pixi-cull does it change the visible flag, which pixi-viewport does not use. Hmm....can you console.log both the viewport.position (or viewport.center) and camera.position and see what happens?
Also i cant use speed in follow script. I cant understand why. I use pixi-culling with pixi-viewport, maybe there are issues connected with that? @davidfig please, help