-
Posts
87 -
Joined
-
Last visited
-
Days Won
1
LinkTree last won the day on August 19 2015
LinkTree had the most liked content!
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
2,086 profile views
LinkTree's Achievements
Newbie (1/14)
12
Reputation
-
@ThanosS You didn't try to modify/extend the engine's physics module? The last update was 2 months ago so it's not that long but yea it definitely seems to have slowed down. Phaser has a lot more developers working on it so that's why there are more frequent updates. What I loved originally about panda was it's writing style, modularity and classes similar to Impact.js and that it offered a canvas+webGL renderer on top. I preferred using it even though I own an Impact.js license but with the ES6 modules and classes soon to be included I guess you could probably use Phaser in a similar way without needing to build it with webpack/common.js. In some ways having less features is also good in some cases because you won't be using all of Phaser's features in every single game so you are adding a lot of unrequired code.
-
What engine version? I tested in v2 and game.scene.addTimer(1000, function() { console.log("timer"); works fine. The reason this.addTimer didn't work in your example is because this refers to the Class class you are extending and it doesn't have an addTimer method. if you wanted your class to have an addTimer method you could extend the Container class instead, or use the Timer class in your own class in a similar way to how the Container/Scene classes are using it. http://ekelokorpi.github.io/panda.js-site/engine/docs/files/src_engine_scene.js.html#l131
-
I see this was over a month ago. Did you find the solution to your issue? @enpu Hey Eemeli, We haven't heard from you in a while. I wanted to make sure everything is alright with you. Are there any news regarding the development of Panda 2?
-
Hi ThanosS, Thank you for your suggestion. I don't have a problem with creating a static blurred background. It's quite simple and there are multiple ways of doing that. What I am trying to create is a dynamic background that changes according to what's behind it in real-time. For that I think I have to use the update function and maybe modify some rendering function but I am not sure and I can't wrap my head around it. Edit: I think I have to edit or extend the engine's renderer to detect my menu class and get the canvas image at that point before it renders the menu itself.
-
SkyzohKey reacted to a post in a topic: Why has game.Text been replaced with game.BitmapText ?
-
I've been trying to implement a menu with a dynamic blurred background behind it for a few days now and I just can't get it to work the way I want it. what I did was to set my menu's update function to copy a rectangle in the size and position of my menu from the game canvas to an off-screen canvas and then blur the off-screen canvas and set a sprite with a the returned texture then draw the menu itself on top of that blurred sprite. The problem is that it copies and blurs the menu itself as well. The only good solution I could think of was to create that menu in html and style it with css and feed it with data and images from the game using toDataURL(). But I really want to make it 100% canvas. the second solution I thought about was to run the game twice and not add the menu container in the second game but it sounds extremely wrong and will hit the game performance. Is there a way to render the off-screen canvas while excluding specific objects? or getting the canvas image before the menu is drawn to it? I couldn't figure it out and I tried many things. I don't want to edit the game engine itself but I might have to. Thank you.
-
I did a quick and dirty test and it seems like anchors work fine during loading. I was able to rotate the progress bar by it's center point and also when I added an image to the scene I was able to rotate it by it's center as well. what didn't work for me is when I loaded the image the loader got stuck but that could be due to me not loading the image properly I haven't tested it heavily just wanted to do something quick. http://ekelokorpi.github.io/panda.js-site/engine/playground/#container_basic game.addAsset('panda.png');game.Loader.inject({ onStart: function() { if (this._dynamic) return; var sprite = new game.Sprite('panda.png'); sprite.position.set(100,100); sprite.anchorCenter(); sprite.rotation = Math.PI/2; sprite.addTo(this.stage); var barWidth = game.Loader.barWidth; var barHeight = game.Loader.barHeight; var barBg = new game.Graphics(); barBg.beginFill(game.Loader.barBgColor); barBg.drawRect(0, 0, barWidth, barHeight); barBg.position.set(game.system.width / 2 - barWidth / 2, game.system.height / 2 - barHeight / 2); barBg.addTo(this.stage); this.barFg = new game.Graphics(); this.barFg.beginFill("#FF0000"); this.barFg.drawRect(0, 0, barWidth, barHeight); this.barFg.position.set(game.system.width / 2, game.system.height / 2); // this.barFg.anchorCenter(); this.barFg.anchor.set(100,10); this.barFg.rotation = Math.PI/2; this.barFg.addTo(this.stage); this.onProgress(); }})game.createScene('Main', { init: function() { var container = new game.Container(); container.position.set(100, 100); container.addTo(this.stage); var sprite = new game.Sprite('panda.png'); sprite.addTo(container); }});
-
I delved into the source code to find a solution for this and I came out with this fix: in loader.js change the parseJSON function to this: parseJSON: function(filePath, callback, request) { if (!request.responseText || request.status === 404) callback('Error loading JSON ' + filePath); var json = JSON.parse(request.responseText); game.json[filePath] = json; if (json.frames) { // Sprite sheet var image = game._getFilePath(json.meta.image); this.loadImage(image, this.parseSpriteSheet.bind(this, json, callback)); return; }else{ callback(); } return json; }
-
I just tested it myself, I am getting the same result as you without any errors in both firefox and chrome. That's definitely an issue. Hopefully Enpu will notice this soon. from my test it seems like the init function of the main scene doesn't get executed. There's probably some method that holds up on executing it until all the files are loaded but the JSON file loader maybe never reports back that the file loaded successfully and it get's stuck. I don't know... it's just an assumption.
-
Hmmmm... Interesting. did you find a solution for this yet? I don't have an iphone/ipad currently so I can't test this myself unfortunately. :/
-
I think it's because you are trying to get the JSON data before it's fully loaded. Try to add an assets.js module and require it in the main module. Something like this: assets.js game.module( 'game.assets').body(function() { game.addAsset('parser.json', 'parserLoads');});main.js game.module( 'game.main').require( 'assets.js').body(function() {game.createScene('Main', {init: function() {var sampleScript = game.getJSON('parserLoads');console.log(sampleScript);}});});
-
Fantastic stuff man! I agree with Steve's comment, I think you are selling yourself short.
- 44 replies
-
You're welcome, I am glad you could find use for this.