Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Panda.js 1.14.0 development


enpu
 Share

Recommended Posts

I'm posting here some updates on Panda.js 1.14.0 development.

 

I have rewritten the whole system module to make it more clearer.

You can test it already from develop branch:

https://github.com/ekelokorpi/panda.js/tree/develop

 

There are now three system attributes:

 

center - Position canvas to center of window.

resize - Resize canvas to fill window.

scale - Scale canvas to fit window.

 

They can be configured from config.js file, like all class attributes:

pandaConfig = {    system: {        center: true,        resize: false,        scale: false    }}

You can combine them anyway you want, giving you 6 different combinations:

 

1. All disabled

 

post-88-0-73017400-1424271615.png

 

2. Only center enabled

 

post-88-0-24315500-1424271615.png

 

3. Only scale enabled

 

post-88-0-70246400-1424271614.png

 

4. Only resize enabled

 

post-88-0-18325800-1424271614.png

 

5. Center and scale enabled

 

post-88-0-69242200-1424271613.png

 

6. Scale and resize enabled

 

post-88-0-13270900-1424271613.png

 

Everything should be working exactly same on mobile and desktop.

 

How do you like it, does that make sense to you?

Link to comment
Share on other sites

You can already bind mouse and touch events into same function.

game.createClass('Example', {    init: function() {        this.sprite = new game.Sprite('example.png');        this.sprite.interactive = true;        this.sprite.mousedown = this.sprite.touchstart = this.mousedown.bind(this);        this.sprite.addTo(game.scene.stage);    },    mousedown: function(event) {        // This is called for both mouse and touch events    }});
Link to comment
Share on other sites

 

You can already bind mouse and touch events into same function.

game.createClass('Example', {    init: function() {        this.sprite = new game.Sprite('example.png');        this.sprite.interactive = true;        this.sprite.mousedown = this.sprite.touchstart = this.mousedown.bind(this);        this.sprite.addTo(game.scene.stage);    },    mousedown: function(event) {        // This is called for both mouse and touch events    }});

Are you sure it does work well with graphics class too, not only sprite class?

Link to comment
Share on other sites

Hi @enpu

 

I'm now getting lots of other errors (these don't happen with the current master) ...

 

There seems to be a 'storage' issue and a 'font' problem.

 

I'm also using the same config file as before and getting errors by default.

 

I tested with both the master and the new develop and I'm only getting these errors with 'develop'.

Also these errors did not pop up with the previous 'develop', if that makes things easier.

 

[Error] SyntaxError: Unexpected identifier 'center'. Expected '}' to end a object literal.

(anonymous function) (config.js, line 21)
 
[Error] TypeError: null is not an object (evaluating 'game.storage.get')
init (main.js, line 34)
Class (core.js, line 964)
_setSceneNow (system.js, line 319)
_setSceneNow (debug.js, line 319)
(anonymous function) (core.js, line 987)
setScene (system.js, line 425)
_onLoaded (core.js, line 696)
(anonymous function) (core.js, line 435)
ready (loader.js, line 173)
update (loader.js, line 204)
run (loader.js, line 193)
(anonymous function) (core.js, line 435)
animate (core.js, line 341)
Link to comment
Share on other sites

  • 2 weeks later...

I think i'm getting rid of that _super function name now, thinking to rename it to just super or parent. What do you think?

(It was named _super because old Android 2.x browsers did not work at all if there was any function named super)

 

I think parent would be more clearer name, but then there is also parent variable on Pixi display objects.

Link to comment
Share on other sites

Hmm I would support staying with the same interface. The biggest reason being that pandajs won't be used in large projects until interfaces are stable and changing some integral part destroys backward compatibility. Therefore, I would suggest keeping the same interface as it was initially set. Unless there is bigger architectural requirement for the change. As this is not the case. I would stick with _super.

 

Which gets me to another point. I was considering using panda in our projects. But I guess until core parts are stable I am to stick with pixijs. :)

 

So @enpu is there a planned lts version or something along those lines?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...