Leaderboard


Popular Content

Showing most liked content since 09/16/2017 in all areas

  1. 3 points
    RaananW

    npm update

    Hi, before I finish the documentation, here is a quick overview: babylonjs 3.1.0-alpha3.4 and all of its modules (materials, serializers, loaders, GUI, post processes and procedural textures) are now npm (and webpack) compatible. To use it: npm install --save babylonjs babylonjs-gui If you are using TypeScript, the typing needs to be added to tsconfig.json: .... "types": [ "babylonjs", "babylonjs-gui", "iAmTheWalrus" ], .... Afterwards it can be imported to the project using: import * as BABYLON from 'babylonjs'; import * as GUI from 'babylonjs-gui'; The next step is you programming a mean game and showing us what came out!
  2. 3 points
    Rybar

    Greeble, a #js13k entry

    Hello everyone! Last week I finished my #js13k entry, Greeble. I'd love it if you guys could give it a play and let me know what you think. http://js13kgames.com/entries/greeble
  3. 3 points
    Hello all, Just wanted to let you guys know that the new CreaturePack runtimes have been accelerated with WebAssembly support: https://github.com/kestrelm/Creature_WebGL You can check out more details and a complete write up here: https://medium.com/@kestrelm/creaturepack-high-performance-2d-webgl-character-animation-with-webassembly-72c436bec86c Live Demo ( requires latest Chrome/Firefox): https://creature.kestrelmoon.com/WebDemo/wasm/PixiJS-WASM-Pack-MultiDemo.html Cheers
  4. 3 points
    click on door to open and close them ! goo.gl/BswF63
  5. 3 points
    RaananW

    OBJ file not loading correctly?

    My Dear Mythros, No, I am not kidding. And I am also not here to argue. I am here to be able to help users that have problems with Babylon. Don't get me wrong, but I am not going to install php on my computer, just because you "worked your ass" off compressing some files. Try actually reading the pinned document in this Q&A forum (here, a link, just in case - ) so you can understand where I am coming from. My opinion regarding forum posts hasn't changed since. I will be more than happy to help (as I did so far), but We both need to have the same state. Which means - providing me a zip file with some php files and a lot of unneeded information will do no good.
  6. 3 points
    pichou

    Reverse Particle System

    Hey deltakosh, Here is a playground of the reverse particles system : https://playground.babylonjs.com/#PSK6N1 Hope it could help other developers. Maybe there could be an option in the BABYLONJS particles system where you define the behavior of the emitter : emit or attrack particules. But the custom function do the job perflectly here. Cheers, Pichou
  7. 2 points
    ozRocker

    3D netball outfits

    I just finished off a website for a company that creates sports uniforms. They wanted something specifically for netball uniforms. They originally had a 2D dress designer but I convinced them to go for 3D http://dyo.100netball.com.au/
  8. 2 points
    adam

    Announcing Babylon.GUI

    Would something like this work? https://www.babylonjs-playground.com/#6SN3TN#4
  9. 2 points
    Hello, I'm new on this forum. Thanks for BabylonJS, it's really great! Actually, I'm working on a solution like AR.js but I detect images, not markers. I use a lot of algorithms for tracking. After few days, it's possible to track an image. I use SolvePnP to determine 3D environment . This algorithm returns 2 vector3, one for the position, one for the rotation. But i've got nothing for scaling. I have also a camera matrix. I'm not sure all values are good, especially for Camera Matrix. Now, I want to use BabylonJS to map a simple plane on top of detected image but I'm completely lost. I've got a first question : which component must be manipulate ? Camera or plane ? If it's plane, how to define camera properties (fov, etc) ? If it's camera, I think plane must be at 0, 0, 0, but which size (size of trigger or just 1 unit) ? How proceed with matrix ? Only on camera or on plane or on plane and camera ? I inspect AR.js and Babylon-ar.js but I don't understand how to apply my results matrix on it. I've read many articles but nothing help... I NEED HELP to solve this (little) problem !!! Could anyone help me ??? Thanks
  10. 2 points
    Lord_Garfield

    Google Fonts once and for all.

    Hi all, I think I found a solution in loading google fonts from your app instead of loading them with the google api. It is inportant to embed your fonts if you want to build native apps. So you can make shure your app works when offline. But using the @font-face in css you still have the problem that your font is not loaded immediatly and text in phaser will be rendered in the default font. Problem description: You load a font with @font-face or google api and you have to trigger a time-out to make shure the font is loaded before you add text in phaser. Using the google api you can write this like phaser.io example http://phaser.io/examples/v2/text/google-webfonts Nice but you can't use a time out when you load your font localy. (maybe a font you created on your own or paid for) There are things like font.js that try to do this but I think it is hard to implement. My solution Get a font Download a .ttf font from google or another place. (not shure if it will work with other types than ttf.) Go to fontsquirrel webfont creator http://www.fontsquirrel.com/tools/webfont-generator upload all fonts to your assets folder (or any other folder you like.) Use the @font-face that was given to you by fontsquirrel so you embed all font types to support almost every browser. Adjust the font-face sources so your path of the font file is set to the correct folder (assets or your folder) Load the font in your html file Put the your @font-face into the header tags of your index file between <style></style> tags. In your body the first element you create is a div with these settings: <div style="font-family:YourFontName; position:absolute; left:-10000px">Font Loaded</div> That is it. Phaser will use this font immediatly. no waiting times. This is becouse the div already loaded the font before phaser is loaded. Just make shure phaser is loaded after document.load. Or in JQuery terms. load it in the function $(function() {}); Kind regards. Lord Garfield
  11. 2 points
    MackeyK24

    Physics Movement

    HOLY SHIT... I FOUND THE PROBLEM... WAS SO FUCKING TINY... Started try to port all my code to your playground and then I saw it.... If moving via Zdir or Xdir ... FRICTION = 0 ELSE FRICTION = BASEFRICTION... I tried setting my player (which had a constant friction 0.1) to just ZERO (constant ZERO) and the MUTHER FUCKER (pleas excuse my language) MOVED PERFECTLY.... Such a Small thing like friction = 0.1 while moving fucks you up... I am gonna implement switching from the BaseFriction giving at design time back and forth to ZERO based on whether I am actually moving or not... But I think that it.... That took TWO WHOLE forum post pages to find that shit.... But FUCK... Its FOUND
  12. 2 points
    gryff

    Mirrored UV's

    @RelativeNull : yes be helpful to post your .blend file - it almost always is ! Ohh - and ignore @Deltakosh 's comments about me And welcome to the forum! cheers, gryff
  13. 2 points
    Wingnut

    Canvas and CSS properties

    You don't use in-browser object inspector, @Pryme8? That shows all props and methods available on sprites and spriteManagers... and any other object. Handy. It will let you answer those easy questions. Here's a nice little sprite playground to learn-from. Wasn't it you that sometimes gets grumpy... because people don't research, read, study, learn? hmm.
  14. 2 points
    I should have looked at the source. For iOS the theoretical max of bones is 32, but in practice it is 22-23. Uniforms other than for bones are going to reduce from the max. Debug shows you have 41 per skeleton. Unless there are many tied up in fingers, toes, and face that can be deleted prior to export, it might be better to just start with a different skeleton.
  15. 2 points
    You can add the onDown input event in create to run once: https://codepen.io/Samid737/pen/aLdpqa
  16. 2 points
    Deltakosh

    Reverse Particle System

    @pichou: Actually I plan to create a particles library where we could add as many behaviors as we want https://github.com/BabylonJS/Babylon.js/issues/2445
  17. 2 points
    aFalcon

    BABYLON.Augmented Reality ... in AR.JS

    Scale down ParentMatrix... and there it is: Utilizing nice fire texture plugin (+1), with stubbed colors. Demo 1.
  18. 2 points
    fenomas

    Physics Movement

    So, there are a few issues stacked up, and there's no "one true" answer to any of them. (Which is to say, Unity might have a single implementation for some part of this but Babylon and programming generally don't.) The fine details depend on what kind of movement you want and maybe on the engine. But at a high level: You should generally never touch a physics object's position or velocity directly. Apply forces and impulses, use constraints, change friction, etc, but let the engine figure out where to put the objects - that's what it's for. The main exception to (1) is, it's fine to zero out velocity to stop a character, or multiply it by 0.99 to slow them down, etc. Things like that make physical sense. Your post mentions touching mesh.position, but that's probably not useful - that just moves the mesh around, disconnected from its physics impostor. Apologies if that was a typo. The only position relevant here is the impostor's position, the mesh position should just be copied from the impostor. The simplest way to hack up physics based movement is usually to (A) read the user input and construct a vector for which direction to move, (B) scale that vector by some value representing how fast the character moves, and (C) apply that vector as a force to the player body. You do this every frame. For jumps you probably want to apply an upwards impulse, not a force. The steps in (4) are the minimum naive way to move a character that's controlled by a physics engine, but they probably won't give you the kind of movement you want. For example, you probably want the character to stop moving fairly quickly after the user releases the move button, but that will only happen if there's significant friction, and if there's a lot of friction, it will take a lot of force to move the character, making things very twitchy. For those kinds of reasons, "real" controllers usually do more stuff, and take some tuning to get what you want.For me in my current project, I do approximately this: First I poll the user input and construct a vector for which direction the player wants to move, scaled up by a value representing their maximum speed. I read the character's current velocity vector, and subtract it from the "desired movement" vector to get a "correction" vector representing which way the player must push themselves to end up moving in the desired direction. I then clamp this vector by some value representing the character's maximum move force, then I apply the result as a force to the player body. Whenever a movement key is pressed, I zero out the player's friction with the ground. When the key is released, I turn friction back on so they stop naturally. I think I also apply a counter-force to help them stop - I don't remember offhand. If the player is airborne, all the above stuff still applies, the player just has much lower move force to represent limited ability to affect their movement, and also apply a drag force for air friction. Incidentally, I think (2) above, with the correction force etc., is something I got from the Quake sourcecode. (3) about turning off player friction during movement is something I got from an article about Sonic The Hedgehog's movement physics. But that's all just one way to do it. You could also, for example, get very precise movement by creating an invisible anchor, moving the anchor precisely where the player directs, and attaching the player body to the anchor by some constraint, like a damped spring. Or lots of other things, if you have a pretty clear idea of what kind of movement you want, and you can envision what sort of physical realities would cause that movement to happen. Anyway that's the vague hand-wavey version. If you were having issues with things like diagonals not working, you probably have a bug somewhere much lower down, like in calculating the movement vector. This can be fairly tricky, since you normally need to do some transforming between world and camera coordinates (that is, pressing "right" probably means move "right relative to the camera", not "move East"). So this high-level rundown may not help much off the bat, but let me know if you have questions about it.
  19. 2 points
    Ianmh

    Iterate through loaded texture atlas

    Found them. PIXI.loader.resources.trees.data.frames
  20. 1 point
    ian

    Latest now

    added lock up/down camera managing and added vr (still have to add VR controller rotating an zooming) Is there any way to mirror desktop browser to phone so vr mouse and keyboard will be VR controller? If player manage camera only horizontal left right playing in not so confusing ... therefore new lock camera (this video has not lock camera and VR but new version has... I just have to add VR joystick mini bloototh controller to add zoom in out and rotating perplexus both circle joystick (x and y values of circle joystick) I have to upgrade VR so player can "teleport" into the game of perplexus
  21. 1 point
    Firenibbler

    Mission 13 - Lost in Space

    Thanks guys! Worked pretty hard on it, just hope it's good enough to place in the compition this year.
  22. 1 point
    brianzinn

    Shadow Blur Problem

    Looks really clean. Totally random, but what is babylonjs.ps.colorAlive-3.0.min.js? Can't seem to find anything about it, code looks like Particle System, so I figured out the ps...
  23. 1 point
    Deltakosh

    npm update

    This will deserve an announcement post
  24. 1 point
    nkholski

    Are you using JavaScript ES 6?

    I wouldn't do anything but very basic stuff without any kind of transpiler anymore, and I would definitely not do anything with phaser without it. Thanks to node and transpilers we don't have to think about browser compatibility or being stuck with aged standards. ES5 is valid ES6 and Typescript so there is nothing new to learn, just new possibilities. With babel or typescript you can focus on your codebase without any worries about deploying the code. Node and projects such as babel has (partly) liberated us from browser hell :-) The same goes for+ css and transpilers such as sass.
  25. 1 point
    RaananW

    Child meshes don't work with physics?

    So, a quick answer before I dive into really understanding what's going on: The physics system is using Babylon's parent system to create compounds. For the physics engine the parent and all of its children (who have a physics impostor) are a single object. or SHOULD be a single object. if this is not the case, I need to find the problem and fix it. I will look at the examples now and will be able to give a better answer.
  26. 1 point
    Does the canvas have somekind of transform applied to it with css? That might make things look a bit blurry also.
  27. 1 point
    You can use ES6 features by using TypeScript. It will be compiled to ES3 or ES5. VSCode is friendly with TypeScript. Phaser has build in support for TypeScript.
  28. 1 point
    aFalcon

    BABYLON.Augmented Reality ... in AR.JS

    UPDATE: bought camtasia. @jeromeetienne, what do you use for AR Video? Hopefully I didn't waste money....
  29. 1 point
    gryff

    Mirrored UV's

    @RelativeNull : thanks for the .blend file:) Now I'm trying to figure out what you mean by " you don't take into account mirrored UV " and what you see as the problem? Here is your character Jack that I exported from Blender but I changed one of the textures to have a green number 2 on the chest. (See image below) Jack Walk towards the character - the image is mirrored. nicely. (I suspect the body and face meshes were created using the mirror modifier. If you don't want the the textures to be mirrored you are going to have to re-uvMap the meshes.) There are other issues though with your model - meshes poking through each other, the ugly shading on parts of the mesh, bones that are not used or set up etc. cheers, gryff
  30. 1 point
    Is canvas running phaser with WebGL? If so, try to change that property to auto or canvas.
  31. 1 point
    Here's an excellent example another developer created, which is similar to what I'd like to do. It's using PixiJS (although it's doesn't hit our cross-browser requirements): https://codepen.io/Yakudoo/full/MyMGBX/ The key difference would be that we'd be be using a mix of raster and vector images and additionally including some simple interactive elements based on click/touch events. Any recommendations on optimizing performance when using so many images? One possible direction we could take, design-wise, would be to cycle the raster images in and out (showing around a dozen at a time) while keeping the vector in. Let me know if there's any other specific details you need. Thanks a lot, Ivan.
  32. 1 point
    ozRocker

    Realtime rigging

    Thanks @Wingnut I can just try it out to see if its possible. The reason I asked when I did is because I was going into a meeting with this sportswear company that already had clothing created from Marvelous Designer. I anticipated them asking if it was possible to use the existing clothing on top of one of my avatars with minimal manual work required. The meeting is over and they'll be giving me some samples so I can experiment with them. Your idea about the transparent skin texture is the official technique used for clothing within Second Life.
  33. 1 point
    Nikolay Sautin

    [For Hire] Pixel art animations

    Hi! My name is Nikolay and I can do pixel art animations for your games. Here's some examples:
  34. 1 point
    I hate cache problems, pixi cache is not user-friendly You have to understand that "remove from cache", "free the videomemory" arel different things, and "destoy the texture" includes all of them. There's also huge difference between Texture and BaseTexture. Make sure you understand all of it before you write that code. You have to iterate through all textures of that spritesheet and remove them from cache, then remove baseTexture: let baseTex = null; for (key in spaceship.textures) { Texture.removeFromCache(spaceship.textures[key]); //or just 'key' will work in that case baseTex = spaceship.textures[key].baseTexture; //they all have same base texture } BaseTexture.removeFromCache(baseTex); Also make sure you remove it from loader, just remove all things : `loader.reset()` or remove "spaceship" and "spaceship_image" from resources list.
  35. 1 point
    mattstyles

    PIXI with React or Angular

    Rendering perf for ng4, React, Vue, Aurelia etc etc etc is all much of a muchness, some other stuff like JS weight (both over the wire and parsing on mobile devices) does vary but largely if you pick any of the larger web frameworks/libs the perf is comparable. No idea how these frameworks/libs performance stacks up against pixi-ui. For me there are usually significant benefits to using the DOM (via vdom or not) when creating UI stuff, but your use-case might differ where the advantages are less. Generally the UI isn't going to be a perf hit unless you've got a ton of animations etc etc but, again, depends on your particular use-case.
  36. 1 point
    Pryme8

    The Wingnut Chronicles

    https://www.babylonjs-playground.com/#B5BDU#60 this is more the behavior I expected https://www.babylonjs-playground.com/#B5BDU#61 and if I increase the tilt it makes it drop to the other side on the ridge... interesting!
  37. 1 point
    SinhNQ

    Water Fluid Simulation

    Hello everyone! I'm making fluid simulation effect, i found a demo: http://jeeliz.com/demos/water/ and i want to clone it. The demo written by WebGL + shader but i don't know about WebGL, i'm worrying . I'm trying export to babylon.js and there are a few things i don't know how to do. I'm really stuck, i expect the babylon community to help me 1. var texture_water = GL.createTexture(); GL.bindTexture(GL.TEXTURE_2D, texture_water); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.NEAREST); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.NEAREST); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_S, GL.CLAMP_TO_EDGE); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_T, GL.CLAMP_TO_EDGE); GL.texImage2D(GL.TEXTURE_2D, 0, GL.RGBA, 512, 512, 0, GL.RGBA, GL.FLOAT, null); 2. var quad_vertex = [-1, -1, 1, -1, 1, 1, -1, 1]; var QUAD_VERTEX = GL.createBuffer(); GL.bindBuffer(GL.ARRAY_BUFFER, QUAD_VERTEX); GL.bufferData(GL.ARRAY_BUFFER, new Float32Array(quad_vertex), GL.STATIC_DRAW); var quad_faces = [0, 1, 2, 0, 2, 3]; var QUAD_FACES = GL.createBuffer(); GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, QUAD_FACES); GL.bufferData(GL.ELEMENT_ARRAY_BUFFER, new Uint16Array(quad_faces), GL.STATIC_DRAW); GL.vertexAttribPointer(SHP_VARS.rendering.position, 2, GL.FLOAT, false, 8, 0); GL.bindBuffer(GL.ARRAY_BUFFER, QUAD_VERTEX); GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, QUAD_FACES); GL.disableVertexAttribArray(SHP_VARS.rendering.position); 3. GL.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_SHORT, 0); GL.disableVertexAttribArray(SHP_VARS.water.position); GL.framebufferTexture2D(GL.FRAMEBUFFER, GL.COLOR_ATTACHMENT0, GL.TEXTURE_2D, texture_normals, 0); GL.useProgram(SHP_NORMALS); GL.enableVertexAttribArray(SHP_VARS.normals.position); GL.bindTexture(GL.TEXTURE_2D, texture_water); GL.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_SHORT, 0); GL.disableVertexAttribArray(SHP_VARS.normals.position); GL.bindFramebuffer(GL.FRAMEBUFFER, null); GL.flush(); With the above code how i export to babylon.js? Thanks so much!
  38. 1 point
    Deltakosh

    Mirrored UV's

    Hello this seems to be a question for our Blender god: @gryff
  39. 1 point
    rich

    Phaser 3 Beta 1 Released

    I'm glad to announce that Phaser 3 Beta 1 is now available. There is a Getting Started guide: http://phaser.io/phaser3/gettingstarted which details how to download it and get up and running. Once you've got it running I'd urge you to check out the Phaser 3 Examples. Click 'Edit' on any demo to see the code and learn from it! There are no docs for Beta 1 as we've been delayed by various issues, but they will start to arrive in Beta 2 in a few weeks time. Nearly all examples up on the Labs will run under Beta 1 as I spent a good while tidying them up. You will still find some that don't run but they should be in the minority now. Any questions - post here! Cheers, Rich
  40. 1 point
    This is a continuation of Phaser multiplayer game tutorial with Node.js server and socket.io. This is part 3 and we're implementing some simple agar.io game mechanics with authoritative server. Part 3: http://gojasonyang.com/post/phaserMultiplayerGamePart3.html
  41. 1 point
    You are a saint. Thanks!
  42. 1 point
    Wingnut

    Reverse Particle System

    Very cool, Pichou! You too, DK! Umm... I see that Jerome is lurking-around, too. So, let's see... a reversed SPS (solid particle system) using lots of different meshParticle shapes... with a little rotation and centrifugal-simulating... could look like a black hole gravity-well... like water swirling down a drain... sucking-up planets and stars. Coooooool. Demented particle experiments... gotta love 'em! Perhaps it is time for Babylon.Tools.Mesh.ForceFields.Attractor() (and Expander/Exploder) (and Container, too, which Jerome has already done). Like a 3dsMax FFD space warp box... but for worldspace/positions instead-of localSpace/verts. Interesting! (or not) "Leaf treatments". You can blow a leaf, suck-up a leaf, or put a box over it. You can burn it, too, but we'll talk about that, later. BabylonJS is not ready for mesh fires, yet. Flammability, conductivity, lightningStrikeSusceptibility, combustibility, verticeMeltingPoint, lots of new props needed, yet. heh (Wingy grabs a bucket of weighted vertices and heads-out to a muddy swamp... to see if they sink.)
  43. 1 point
    mattstyles

    Can't load images by any means.

    Your call to `express.static('assets')` sets `assets` as the base folder, which means that when you request `/snakeBody.png` it looks at the root, which is (as far as the static module knows) at `assets`. `../../assets/snakeBody.png` does not work because paths don't go relative to where your JS file is, they'll go relative from wherever you serve your html file from ordinarily, there are some rules (such as the `static('assets'`) which can change how your server routes requests.
  44. 1 point
    samme

    Show FPS

  45. 1 point
    mattstyles

    code not understood

    var gameTitle = function(game){} gameTitle.prototype = { create: function(){} } It's a JS pattern to add class-like behaviour into a prototypal language, if you know what classes are (in Java, C++ etc for example) then its pretty akin to that. The top function call is a constructor function, the prototype bit adds methods (behaviours) to your class. You should just call this an object as JS doesn't have traditional classes (despite the new class syntax). The way you're doing it though stamps over any existing methods on the prototype, this is generally bad, sometimes very bad. Extending the checkout with additional functionality is fine but be careful stamping over it, particularly if you're setting up some sort of inheritance chain.
  46. 1 point
    Arte

    Announcing Babylon.GUI

    Hi phaselock, button.children[0].text="Cancel"; line 40; PG
  47. 1 point
    Deltakosh

    The Wingnut Chronicles

    On a side note I plan to add scrolling capabilities to GUI (one day :))
  48. 1 point
    Hi, by default PTM is set to 50. Also when you call: game.physics.startSystem(Phaser.Physics.BOX2D); Default debug draw is initialized. It has to convert box2D meters to pixels, so it is using also PTM. When you then set PTM to different value, it changes it in box2D physics engine, but not in debug draw module. So, your game works correctly, while it may sound surprising. Problem is, that box2D flipper is drawn with old PTM (50) - so debug draw is scaled down. To correct it call it like this: game.physics.box2d.ptmRatio = 500; game.physics.box2d.debugDraw = new Phaser.Physics.Box2D.DefaultDebugDraw(500); game.physics.box2d.world.SetDebugDraw(game.physics.box2d.debugDraw); It will reinitialize debug draw with new PTM. While it will solve your problem, I think, you will still not like it, as your pinball table now will be 10x bigger than before, but it is drawn correctly. Using PTM 500 is not good. Circles in your table are crated with size like 2.8 meters. But as it is then converted into pixels with PTM 500 then circle is 2.8 * 500 = 1400 pixels... Last thing, I noticed is, that you are using some older version of Phaser box2D plugin. Get new one - it has method setPTMRatio(PTM) and this method resets debug draw for you automatically.
  49. 1 point
    valueerror

    How to remove a constraint in p2

    of course.. you just should keep track of your constraint.. usually i store the constraint directly on one of the constrained objects.. somesprite.constraint = game.physics.p2.createRevoluteConstraint(somesprite.body, [0,0], someothersprite.body, [0,0], 10000);then i delete it with: game.physics.p2.removeConstraint(somesprite.constraint);somesprite.constraint = null;you could also clear ALL constraints at once: function clearAllConstraints(){ var allConstraints = game.physics.p2.world.constraints.splice(0,game.physics.p2.world.constraints.length); if (allConstraints.length > 0){ for (i=0; i<=allConstraints.length; i++){ game.physics.p2.removeConstraint(allConstraints[i]);} }}note that i use a workaround to get all constraints because the last time i checked the "getConstraints()" function returned "undefined" (i already reported the bug so it's probably fixed by now)
  50. 1 point
    BdR

    Button text

    Excellent answers here, I really like the extension of a standard button to a custom label button. It wasn't immediately obvious to me how to add such a button object to the game, but this is how I did it: create: function() { .. ‚Äč // adding a custom label button this.btnStart = new LabelButton(this.game, 480, 512, "buttonsprite", "Start game!", this.doBtnStartHandler, this, 1, 0, 2); // button frames 1=over, 0=off, 2=down .. }