proyecto26 / Phaser-Kinetic-Scrolling-Plugin

Kinetic Scrolling plugin for Canvas using Phaser Framework
https://proyecto26.github.io/Phaser-Kinetic-Scrolling-Plugin/
MIT License
132 stars 26 forks source link

Scrolling large bodies of text within a group #11

Closed asciifaceman closed 8 years ago

asciifaceman commented 8 years ago

I am wondering if this plugin would work for this use case.

I have a panel I made, say:

    // Tall panel
    var panelTall = this.game.add.bitmapData(250, 500);
    panelTall.ctx.fillStyle = '#5a6772';
    panelTall.ctx.strokeStyle = '#31363a';
    panelTall.ctx.lineWidth = 5;
    panelTall.ctx.fillRect(0, 0, 250, 500);
    panelTall.ctx.strokeRect(0, 0, 250, 500);
    this.game.cache.addBitmapData('panel', panelTall); 

And then I instantiate it in a group:

    this.stableGroup = this.game.add.group();
    this.stableGroup.position.setTo(25, 250);

    this.stableBody = this.stableGroup.addChild(this.game.add.image(0, 0, this.game.cache.getBitmapData('panel')));

Now within this I want to populate it with text objects vertically, and have it scrollable vertically at the borders roughly of the panel. Every comment thread seems to have you posting this library as an example but I can't seem to figure out how it would work like this.

jdnichollsc commented 8 years ago

Check the current examples please. Regards, Nicholls

asciifaceman commented 8 years ago

Yes I have been all over the current examples. But if you just want to close this and wash your hands fine, but stop posting your plugin all over as the answer to this solution if you are unwilling to document its use properly.

jdnichollsc commented 8 years ago

If you want, you can see the code, learn about Phaser (Camera, fixedToCamera) and later improve the documentation with a Pull Request! ;)

asciifaceman commented 8 years ago

I was a little hasty with my pre-coffee monday morning reply. However I'm fairly familiar with Phaser and I wrote a window manager for it, however I Can't seem to understand how your work... works. Every example seems to be camera only and not moving objects. I can't for the life of me think of how to make my use case work, and that might just be how it is.

I only want to scroll objects (like an infinite text list) not the entire camera.

jdnichollsc commented 8 years ago

Sorry, for the moment this plugin only works with the camera, but any contribution to the community is totally welcome 👍

asciifaceman commented 8 years ago

I might have to roll my own solution I guess then. With the knowledge you gained writing this, do you have any input on how to handle it?