Ninjadoodle Posted April 23, 2015 Share Posted April 23, 2015 Hi @enpu Thanks heaps for the detailed explanation! I will give this a go Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted April 23, 2015 Share Posted April 23, 2015 Hi @enpu Does 'gotoAndStop(frame)' still work with animations? I've tried the new format and can't get it to work. I used gotoAndStop(), all the time in the previous version of Panda I also think that 'fromFrames' was really useful. Thank you in advance! PS. setTexture(); doesn't seem to work either. Quote Link to comment Share on other sites More sharing options...
enpu Posted April 24, 2015 Author Share Posted April 24, 2015 use anim.stop(2); to stop at frame index 2. Also there is still game.Animation.fromFrames function How is the setTexture not working? Can you show code how you use it? Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted April 28, 2015 Share Posted April 28, 2015 Is it possible to resize a sprite in the 2.0 ?I tried to do something like that but it doesn't worked:game.createClass('Ground', 'Sprite',{ texture: "choco.png", tint: 0xfff000, init: function(type, x, y, width, height) { console.log("New Ground", type, x, y, width, height); this.width = width; // Don't work. this.height = height; // Don't work. }} Quote Link to comment Share on other sites More sharing options...
enpu Posted April 28, 2015 Author Share Posted April 28, 2015 That does not work yet, but will fix that soon Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted April 28, 2015 Share Posted April 28, 2015 Hi @enpu I've downloaded a newer develop version and like you said, all the things I mentioned above work Thank you!! Quote Link to comment Share on other sites More sharing options...
enpu Posted April 29, 2015 Author Share Posted April 29, 2015 That's great! Quote Link to comment Share on other sites More sharing options...
goide Posted May 4, 2015 Share Posted May 4, 2015 @enpu You can upload or update a game with new features, or how to write the code Panda Engine2.0.0, It would be helpful to this new change. Quote Link to comment Share on other sites More sharing options...
enpu Posted May 4, 2015 Author Share Posted May 4, 2015 Yes i will do that when 2.0.0 is ready Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 7, 2015 Share Posted May 7, 2015 Hi guys Does anyone know what the function used to listen for an orientation change is? I've tried 'rotateScreen' but it doesn't seem to be working. window.addEventListener('rotateScreen', rotateContainers); Quote Link to comment Share on other sites More sharing options...
enpu Posted May 7, 2015 Author Share Posted May 7, 2015 'resize' should work Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 7, 2015 Share Posted May 7, 2015 Hi @enpu Thank you!! Just tried it and it works Quote Link to comment Share on other sites More sharing options...
Neso Posted May 7, 2015 Share Posted May 7, 2015 Just watch out as resize will fire on iOS devices when browser URL bar is shown or hidden. SkyzohKey 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 7, 2015 Share Posted May 7, 2015 Hi @Neso and @enpu Thanks for the heads up! Is there any way I can prevent this from happening? Quote Link to comment Share on other sites More sharing options...
Neso Posted May 8, 2015 Share Posted May 8, 2015 Preventing no. Also note that it isn't consistent behaviour with tabs opened and so on. Yes safari is real mess at the moment. But you can detect whether you are in full screen or not. Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted May 9, 2015 Share Posted May 9, 2015 When using Panda Physic engine all dynamic objects pass over the static grounds after they touch them, this is a bug I guess. Quote Link to comment Share on other sites More sharing options...
enpu Posted May 10, 2015 Author Share Posted May 10, 2015 That is because there is no velocity limit by default, so your y velocity will grow even when you collide. Try body.velocityLimit.y = 200;or set your y velocity to zero when you collide Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 12, 2015 Share Posted May 12, 2015 Hi @enpu Just wondering if the syntax is still the same for this, as I can't seem to get it working ... smileyPiece1.mousedown = smileyPiece1.touchstart = function(event) { console.log(event.target.x);} Thank you! Quote Link to comment Share on other sites More sharing options...
mirage29 Posted May 13, 2015 Share Posted May 13, 2015 Hi! Is Panda 2.0.0 use pixi v3? Quote Link to comment Share on other sites More sharing options...
enpu Posted May 13, 2015 Author Share Posted May 13, 2015 @Ninjadoodle check out Input examples from playground: http://ekelokorpi.github.io/panda.js-site/engine/playground/ @mirage29 Panda 2.0.0 uses customized Pixi v2. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 13, 2015 Share Posted May 13, 2015 Hi @enpu Sorry, I forgot about the playground examples! It looks quite different from the way I did things in 1.xx I used event.target quite a bit, but in the examples it seems to favour using classes, with no mention of event.target. I have no problem using classes to create my objects, but sometimes find it a bit unnecessary. Sometimes I'd also like to use the same function on a number of sprites (I think I can inject the sprite with the function ) I think that event.target was quite convenient and wondering whether there is a chance of it coming back? Thank you! Quote Link to comment Share on other sites More sharing options...
enpu Posted May 13, 2015 Author Share Posted May 13, 2015 It is not very different from 1.x, just function parameters are a bit different, and there is no need to define touch functions separately anymore. Example:var sprite = new game.Sprite('panda.png');sprite.interactive = true;sprite.mousedown = function(x, y, id, event) { console.log(x, y); // Mouse/touch position console.log(id); // Touch id (for multi-touch) console.log(event); // Original mouse/touch event}; Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 13, 2015 Share Posted May 13, 2015 Hi @enpu Thank you for the explanation ... but what if I wanted to do something like this ... touchTest = function(x, y, id, event) { event.target.rotation = 0.5*Math.PI;}; smileyPiece1.mousedown = smileyPiece1.touchstart = touchTest;smileyPiece2.mousedown = smileyPiece2.touchstart = touchTest; Quote Link to comment Share on other sites More sharing options...
enpu Posted May 13, 2015 Author Share Posted May 13, 2015 Just use 'this'var mousedown = function() { this.rotation += 0.1;};var sprite = new game.Sprite('panda.png');sprite.interactive = true;sprite.mousedown = mousedown;sprite.addTo(this.stage); Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted May 13, 2015 Share Posted May 13, 2015 So simple! Thank you heaps!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.