Sentinel 4 Report post Posted December 5, 2017 I've taken a look at pixi-viewport and I really like it except for the ease drag part and the fact that it can't return a PIXI.DisplayObject that I can add myself to the stage and render it. t So I have a Pixi.Container I want the camera to move around instead of it inheriting the render and using its own render loop. Basically I want the same result as the Phaser.io Camera Maybe the documentation is just confusing me, but I can't seem to get it to work like I want. Is there any other way to do this? Because I want to have a GUI overlay. Quote Share this post Link to post Share on other sites
ivan.popelyshev 1078 Report post Posted December 5, 2017 Search for "camera" in this subforum, I've made some simple solutions and people commented with their editions. Quote Share this post Link to post Share on other sites
Sentinel 4 Report post Posted December 5, 2017 22 minutes ago, ivan.popelyshev said: Search for "camera" in this subforum, I've made some simple solutions and people commented with their editions. Found what I was looking for. Is there any way I can implement a mouse drag event? So the camera follows the cursor position while dragging, and doesn't when drag has ended. Quote Share this post Link to post Share on other sites
ivan.popelyshev 1078 Report post Posted December 5, 2017 I had that thing buried somewhere. Sorry, its lost. You have to look up all the threads about drag , and take closest solution. Oh, wait, found one: http://pixijs.io/examples/#/projection/basic.js , good example of how to drag and click elements. Dont mind pixi-projection usage. If it doesnt suit you, learn how toLocal/toGlobal and those things work, I'm sure you can find solution. I've used something like that for 2d maps and elements on them before. Quote Share this post Link to post Share on other sites
Sentinel 4 Report post Posted December 6, 2017 1 hour ago, ivan.popelyshev said: I had that thing buried somewhere. Sorry, its lost. You have to look up all the threads about drag , and take closest solution. Oh, wait, found one: http://pixijs.io/examples/#/projection/basic.js , good example of how to drag and click elements. Dont mind pixi-projection usage. If it doesnt suit you, learn how toLocal/toGlobal and those things work, I'm sure you can find solution. I've used something like that for 2d maps and elements on them before. Got it working from the projection example. Thanks a lot for the spoonfeeding 1 ivan.popelyshev reacted to this Quote Share this post Link to post Share on other sites
ivan.popelyshev 1078 Report post Posted December 6, 2017 Nice! One more point to that implementation, I'll put it in wiki or cookbook later. Quote Share this post Link to post Share on other sites
Vivraan 0 Report post Posted January 8 Sorry for reviving this dead thread, but is modifying the position of the stage of an Application object feasible for this? Quote Share this post Link to post Share on other sites
ivan.popelyshev 1078 Report post Posted January 8 That's default solution. You can also use "pivot" and not a position. basically, stage.position.set(renderer.screen.width/2, renderer.screen.height/2); stage.scale.set(1.33);//scale it whatever you want stage.pivot.set(myCharacter.x, myCharacter.y); //now character inside stage is mapped to center of screen Quote Share this post Link to post Share on other sites