Stephan

Members
  • Content Count

    139
  • Joined

  • Last visited

  • Days Won

    1

Stephan last won the day on October 15 2014

Stephan had the most liked content!

2 Followers

About Stephan

  • Rank
    Advanced Member

Recent Profile Visitors

1972 profile views
  1. Hi @enpu, I just encountered en fixed a small bug in the p2 pulgin. Since it is not open source, I cannot create a pull request so I decided to post it here instead: p2.js line 13876: context.rect( -shape.width / 2 * body.world.ratio, -shape.height / 2 * body.world.ratio, shape.width * body.world.ratio * game.scale, shape.height * body.world.ratio * game.scale ); should be: context.rect( -shape.width / 2 * body.world.ratio * game.scale, -shape.height / 2 * body.world.ratio * game.scale, shape.width * body.world.ratio * game.scale, shape.height * body.world.ratio * game.scale ); Hope this is helpful. Stephan
  2. I just had another look at the problem and I think it is a small bug in the engine. I just posted a pull request for the develop branch to fix the problem.
  3. Hi, I just came across a small hires problem when drawing graphics. settings: game.config = { name: '', system: { width: 150, height: 100, scale: false, center: true, resize: false, hires: 1 }, mobile: { } }; the code: var grap = new game.Graphics().addTo(this.stage); //red shape with bezier curve grap.fillColor = '#ff0000'; grap.drawPolygon([ {x: 0, y: 0}, [50, 0, 50, 0, 50, 20], //this is a bezier curve! {x: 50, y: 40}, {x: 0, y: 40}, {x: 0, y: 0}, ]); //white shape to show the intended outline points grap.fillColor = '#99cc99'; grap.fillAlpha = 0; grap.lineColor = '#ffffff' grap.lineWidth = 2; grap.drawPolygon([ {x: 0, y: 0}, {x: 50, y: 20}, {x: 50, y: 40}, {x: 0, y: 40}, {x: 0, y: 0}, ]); This is the shape @ hires=1x (as it should be drawn): And here is with hires=4: Am I doing anything silly here or might this be a bug? It appears that the coordinated are not translated to the hires scale... Thanx, Stephan
  4. thank you so much again for this quick update! It works perfectly now. 😃
  5. oh, sure. Forgot about that... Here it is attached. example.zip
  6. hi @enpu, It looks like I found another small problem with TilingSprites when hires is enabled. config file: game.config = { system: { width: 320, height: 320, scale: false, center: true, resize: false, hires: 2 } }; This is the code. (I added panda@2x.png to the media folder) game.module( 'game.main' ) .body(function() { game.addAsset('panda.png') game.createScene('Main', { init: function() { this.sprite = new game.TilingSprite('panda.png', game.width, game.height).addTo(this.stage); }, update: function() { this.sprite.tilePosition.x -= 100 * game.delta; } }); }); The background now has a gap when it is moved to the left. (This gap is sequential).
  7. Thanks for your quick response. It works perfectly!
  8. Hi @enpu, I just encountered a bug in the TimingSprite class. It appears when you try to add multiple tiles to the game.: game.module( 'game.main' ) .body(function() { game.addAsset('panda.png') game.addAsset('cloud1.png') game.createScene('Main', { init: function() { this.sprite = new game.TilingSprite('panda.png', game.width, game.height).addTo(this.stage); //this semi-transparent tile replaces the texture of the first tile! this.sprite2 = new game.TilingSprite('cloud1.png', game.width, game.height).addTo(this.stage); //this however does work //this.sprite2 = new game.Sprite('cloud1.png').addTo(this.stage); }, }); }); I added an example project as attachment so you can reproduce the problem easily 😊 example.zip
  9. there is no public property available but you could use the following private property timer._pause working example: var timer = game.Timer.add(1000, function() { sprite.remove(); }); if(timer._pause){ console.log("paused") } else{ console.log("Not paused") }
  10. Yes, that is exaclty what I suspected! Thanks for confirming. Now I am sure that I have got things set up correctly. 😊
  11. Hi @enpu Thanks for your extended explanation. 🙂 About your reply: This bit is perfectly clear now. I have tested it thoroughly and it works exactly as expected. Great mechanism! Is it correct to say that the game.System.scale property is used as a means to make hires working? In system.js I find the following code fragment: for (var i = 2; i <= game.System.hires; i += 2) { var ratio = game.System.hiresRatio * (i / 2); var width = game.System.hiresDeviceSize ? game.device.screen.width : this._windowWidth; var height = game.System.hiresDeviceSize ? game.device.screen.height : this._windowHeight; if (width >= this.originalWidth * ratio && height >= this.originalHeight * ratio) { this.hires = true; game.scale = i; } } Good to know. For now I think I stick to a singls easpect ratio to keep things simple. Thanks, Stephan
  12. I just gave it a try it and the problem has indeed been fixed. thank you for the quick patch! 😃
  13. no one? Let me provide a little context here. I am working on a small engine adaption that improves crisp rendering at the most common monitor resolutions. Currently, most of my end users are using resolutions like: 1024x768 1280x920 1600x1200 1920x(1080/1200) Now I want Panda to scale to the maximum screen size from the list above that still fits on the monitor. For this purpose, I made a few alterations to system.js. With the alterations, Panda now chooses the largest scale that fully fits to the screen and renders the game at that resolution. For example: When a game is projected on a screen size of 1100pxx851px, the game is rendered at 1024x768 pixels). I have extended the hiresRatio property in system.js like so it accepts the following config settings: game.config = { system: { width: 1024, height: 768, scale: false, center: true, hires: 8, hiresRatio: [1, 1.25, 1.5625] //NEW! the property now accepts an array with custom values for ratio }, ... }; the altered code of system.js: if(game.System.hiresRatio instanceof Array){ //in case of new custom array, iterate the array and use these specific ratio's for (var i = 0; i < game.System.hiresRatio.length; i++) { var ratio = game.System.hiresRatio[i]; var width = game.System.hiresDeviceSize ? game.device.screen.width : this._windowWidth; var height = game.System.hiresDeviceSize ? game.device.screen.height : this._windowHeight; if (width >= realWidth * ratio && height >= realHeight * ratio) { this.hires = true; game.scale = ratio; } } } else{ //otherwise the usual code with a few adaptions for (var i = 2; i <= game.System.hires; i += 2) { var ratio = game.System.hiresRatio * (i / 2); var width = game.System.hiresDeviceSize ? game.device.screen.width : this._windowWidth; var height = game.System.hiresDeviceSize ? game.device.screen.height : this._windowHeight; if (width >= realWidth * ratio && height >= realHeight * ratio) { this.hires = true; game.scale = i; } } } It really works like a charm so far, just want to be sure I don't mess up anything vital in panda.. 😊
  14. It appears that the bug hasn't been fully resolved. When I import a a 'normal' .atlas file (exported with Texture Packer, Panda 2 settings) in addition to the spine atlas, I receive the following error: spine.js:6610 Uncaught TypeError: Cannot read property 'responseText' of undefined at Class.parseAtlas (spine.js:6610) at core.js:955 at Class._loadCallback (loader.js:200) at Class._onload (texture.js:87) at HTMLImageElement.<anonymous> (core.js:955) Steps to reproduce te problem: download the current spine plugin + demo project (plugin v.1.3.3). add the attached .atlas file to the project (test.atlas + texture pack with a single image: ) import the .atlas file the usual way with: game.addAsset('test.atlas'); Any help would be appreciated.
  15. Hi there, I'm currently intergration some panda games in my webapp. In order to scale the canvas nicely, I am working on some custom adaptions to regulate the canvas size and resolution an bit more fine grained than with autoscale. I am having some trouble however understanding the game.System.hiresRatio property that is described in the documentation. This is what it says: When I have a look at the source code op Panda2 it comes down to the following bit of code: for (var i = 2; i <= game.System.hires; i += 2) { var ratio = game.System.hiresRatio * (i / 2); var width = game.System.hiresDeviceSize ? game.device.screen.width : this._windowWidth; var height = game.System.hiresDeviceSize ? game.device.screen.height : this._windowHeight; if (width >= realWidth * ratio && height >= realHeight * ratio) { this.hires = true; game.scale = i; } } The default value of hiresRatio=2 makes perfect sense. However, any other value appears to give a difference between game.scale ending up a different value than ratio. For example, have a look at the following settings: game.config = { system: { hires: 8, hiresRatio: 3 } }; gives at a certain screen size the following values: ratio=9 game.scale=6 @enpu: Is this intentional? Shouldn't the values ratio and game.scale always be the same? And on a wider scope: What is hiresRatio used for (in other cases than the default value = 2)? Hope you can help me out a bit. Stephan