• Content Count

  • Joined

  • Last visited

Everything posted by RetardVeverca

  1. Oh my .... what a stupid mistake ... I had the old index.html so I had referenced wrong script: src/engine/config.js instead of src/game/config.js where my true config lies Thanks for the help though!
  2. Originally I had the syntax from code snippet you linked, but then I changed to FlyingDog demo syntax, which is: pandaConfig = { sourceFolder: 'src', outputFile: 'game.min.js', sitelock: '', analyticsId: 'UA-42024756-5', storageId: 'net.pandajs.flyingdog'};I just changed back to your suggestion to verify it again and I still get same error (in browser and on CocoonJS launcher) ...
  3. Ful stack trace of error: Uncaught TypeError: Object function Class() { if(!initializing) { if(this.staticInit) { /** If Class has `staticInit` function, it is called before `init` function. @proper...<omitted>...t' main.js:54game.Scene.extend.init main.js:54Class loader.js:217(anonymous function) core.js:570animate
  4. Hi! I can not get local storage to work. I set up config, where I declared Id: pandaConfig = { sourceFolder: 'src', mediaFolder: 'media', sitelock: '', outputFile: 'game.min.js', storageId: 'com.netprojekt.chicktest'};And then I try to use it in scene Init function like so: this.score = game.Storage.get('highscore') || 0;And I get an error: Uncaught TypeError: Object function Class() { if(!initializing) { if(this.staticInit) { /** If Class has `staticInit` function, it is called before `init` function. @proper...<omitted>...t' I changed from ( to game.Storage.get otherwise I get: Uncaught TypeError: Cannot call method 'get' of null
  5. Thank you, your fix works I think if there is no difference regarding mobile use (like with DOM, which waits for doubleclick and touch is not the same as click in some engines), I think it should autobind. If there are differences, then not Also I just figured it out, it works (without updating your fix from master branch) if I set my sprite with shorthand version like so: this.ozadje = new game.Sprite('start', 0,0, { anchor: {x:0, y:0}, interactive: true, mousedown: function() { game.system.setScene(SceneMenu); } }); this.stage.addChild(this.ozadje); Why is that?
  6. And if I remove the mousedown event from sprite in first scene and instead make whole scene interactive: SceneStart = game.Scene.extend({ backgroundColor: 0x000000, init: function() { this.ozadje = new game.Sprite('start'); this.ozadje.anchor.set(0, 0); this.ozadje.position.set(0,0); this.ozadje.interactive = true; this.stage.addChild(this.ozadje); }, mousedown: function() { game.system.setScene(SceneMenu); }});everything works. So there is really a problem in my mousedown event only for sprite!
  7. Hi! I have developed many demos with Panda.js, but today I tried one of them and mousedown event (on sprite) suddenly stopped working. It works in browser but not in CocoonJS launcher or cocoonJS packaged APK. I did not changed CocoonJS launcher, I also built the APK with same (1.4.7) version nor did I changed Panda.js. There are no errors shown in Chrome debug window nor in CocoonJS debug mode. Because I couldnt find any errors and I stripped the code entirely I updated Panda.js to new version and now I get an error in CocoonJS launcher debug mode: Javascript Exception (Tag: 'touchend'): TypeError: Cannot read property '70' of undefined at PIXI.InteractionManager.onTouchEnd(src/engine/renderer.js:3757:33) at HTMLCanvasElement. <anonymous> (src/engine/core.js:572:18) My source code: game.module( 'game.main' ) .require( 'engine.core') .body(function() { game.addAsset('media/backi.png', 'start'); game.addAsset('media/countdown.png', 'menu'); SceneStart = game.Scene.extend({ backgroundColor: 0x000000, init: function() { this.ozadje = new game.Sprite('start'); this.ozadje.anchor.set(0, 0); this.ozadje.position.set(0,0); this.ozadje.interactive = true; this.ozadje.mousedown = function(){ game.system.setScene(SceneMenu); }; this.stage.addChild(this.ozadje); }});SceneMenu = game.Scene.extend({ backgroundColor: 0x000000, init: function() { this.ozadje2 = new game.Sprite('menu'); this.ozadje2.position.set(0,0); this.ozadje2.anchor.set(0, 0); this.stage.addChild(this.ozadje2); } }); game.System.idtkScale = 'ScaleAspectFill'; game.start(SceneStart, 480, 800); }); And you can download .zip for uploading to CocoonJS here:
  8. Nice update I like the new look of website ... more clean and transparent
  9. Wow, fast answer, thank you so much! Panda.JS is great, it really allows rapid development and it works so fast even on older androids
  10. Hi! I have a problem of centering BitmapText after it has been updated with setText method and it's dimension changed. Does someone know how to do it? I have my text defined as:this.score = new game.BitmapText('0', {font: 'soupjustice64w'});this.score.position.x = game.system.width/2;this.score.position.y = game.system.height/2;game.scene.stage.addChild(this.score);And then I update it and want to set new position: this.score.setText('300');this.score.position.x = (game.system.width/2)-(this.score.textWidth/2);this.score.position.y = game.system.height/2;But this doesnt work :/
  11. Thanks enpu So if I set canvas and position elements like you suggested, is it best to set few different sprite dimensions for every object and select them with respect to game.device.pixelRatio or use max. dimension sprite and scale it down with resepect to game.device.pixelRatio?
  12. Yes, only when used with ScaleAspectFit. ScaleAspectFill of course fills the screen with respect to scale and ScaleToFill stretches to fill the screen. So the problem exist with ScaleAspectFit where areas outside letterbox should be 'dead' (I would assume with background color set in scene) but are instead showing parts of canvas itself. I tested it on two devices: Sony Xperia Arc running 4.0.4 and Sony Xperia J running 4.1.2 I will test on some other devices tomorow ...
  13. Ok, so this is done automatically by CocoonJS, thats great So basically I set it up with lets say 768 x 1024 for portrait mode and set game.System.idtkScale = 'ScaleAspectFill'; like the way it is done in flying dog demo, but this still leads to some part of the game not being visible on certain screens? If I set to 'ScaleAspectFit' some parts are out of canvas (letterboxing) and 'ScaleToFill' stretches content of course. And if the fixed higher resolution is actually the solution, what is the most appropriate resolution for portrait and landscape mode respectively? And thanks for answer
  14. Hi I have a problem when setting game.System.idtkScale = 'ScaleAspectFit'; and running game with CocoonJS. The space outside canvas (letterbox) is reproducing parts of canvas itself, so you get multiples of canvas instead of black border as you should with letterboxing. Is it bug? Or do you have to set another parameter so that ScaleAspectFit will work properly? (I've tested it many times with different games and the problem is always there) Screenshot:
  15. And do you define positions in % so the items will be positioned corectly? Is it maybe the solution in SVG graphics? Or do you develop in fixed resolution (1024 x 768 for instance) and scale based on detected resolution? I know many many questions .. I know there is millions of solutions (I've read many articles about this problem including android developers guidelines), but my main question is, what is the prefered way with Panda.js (with CocoonJS)?
  16. Hi What is the best way to support multiple screen resolutions and different aspect ratios on Android devices? (I am developing 2d game with CocoonJS) I know you can scale it with idtkScale when working with CocoonJS, but that is not the perfect solution. Do you make highest resolution sprites and scale them down with game.scene.stage.scale.set ? And where can I find more about this function and others which might be useful like, hiresFactor, hires, retina and other properties of game.System class? Is maybe this the best solution? And how would I implement it properly in Panda.js? Regards
  17. Is there any plan on supporting Tiled ( ? It is supported by numerous game engines (11 of those are html5 in fact) and it is really good tool to use, specially when you seperate graphic designer/level editor with programmer Of course you can parse the files yourself, but it would be great if it would be integrated in to Panda.js. And complete article on doing just that:
  18. O yes, thank you for clarification, I dont have any sprites yet, just shapes so thats the reason It would be great otherwise for another screencast about bodys, shapes, collisions, sprites and combining all together, best in some simple real game world situation
  19. Aha ok thx I will try What about "game.DebugDraw.enabled = true"? Why is it used in Simple physics example, but not in Flying Dog? What is the proper way for drawing to the screen? Thank you
  20. Hi. First I must say this is awesome engine, so simple, so fast ... thank you very much But I have problem with your Simple physics example, the canvas is not full screen (nor landscape nor portrait), I further tested it with mousedown and the canvas is truly not extended to the edges (at lease 1/3 of screen is out of bounds in landscape mode). I tried adding X and Y values to game.start() but this causes part of the screen that is outside to flicker and/or show multiple objects from game going in reverse direction. I also tried to set size with window.innerWidth and window.innerHeight but that causes game to be overstretched and almost 1/3 of canvas falls out of screen. So my question is, what is the best way to set screen size for multiple devices (from 320px up)? My second question is why is there "game.DebugDraw.enabled = true" in Simple physics example, but not in Flying Dog? My app does not render anything without game.DebugDraw.enabled set to true? I am working on Sony Ericsson Xperia Arc S (LT18i), android 4.0.4 with CocoonJS Launcher. Thank you and keep up the good work!