Jump to content

Search the Community

Showing results for tags 'remove'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 18 results

  1. I have recently run into a problem with the physics joints in Babylon. I add a distance joint between two impostors in my scene, but after some time, I would like to remove that joint. Currently on the docs, there is no reference to a removeJoint function, and after looking into some of Babylon's source code, I found the function link: https://github.com/BabylonJS/Babylon.js/blob/master/src/Physics/babylon.physicsEngine.ts However, the function appears as if it is not complete, and I am unsure of the proper way to access it. Is there a way to properly remove a physics joint?
  2. SwanUp

    Remove Button

    Hi, I'm new to programming in Phaser so I'm having a few problems. A lot of them I could have figured out using the API or this forum here. But now I'm facing a problem which I can't solve. It's basically an easy thing but I just can't solve it. It's just the simple removing of an button. I tried everything using .destroy() or .kill() or even pendingKill() which I've seen on the examples on Phaser.io. I've also tried things like making it invisible or use an invisible sprite or just a blanc picture but I can't set the frame to this. So is there anyone who can help me figuring that out I would really appreciate it. Hope to get some good replys, Luca
  3. Hi folks, I need help! How can I remove a constraint?! I have: game.physics.p2.createRevoluteConstraint(nearest, [0,0], newRect2, [0,0], maxForce); Later, in the code, I need to destroy the layer, but before to do that, I need to remove the constraint!
  4. Hi all, I'm trying to use Slick UI to dynamically create multiple choice question prompts in a new game (see image). The problem is, there doesn't seem to be a way to remove a panel, or update its child elements once they have been created. I couldn't find a way to do this directly through Phaser either. Any help greatly appreciated. Perhaps there is a Phaser method to destroy all children generated by a particular plugin? Cheers, Paul.
  5. Hi guys! How I can remove the polygons from my model or remove some varticies or edges. In short, how to cut off part of model? or babylong and webGl dosn't have such possibility? Thank!
  6. Hello, is it the correct behaviour that instances that are being disposed doesn't get removed from ShadowGenerator.getShadowMap().renderList ? I have the refreshrate set to 0 and only render with shadow on demand. if (_renderShadow && this._manuallyShadowRender) { this._shadowGenerator.getShadowMap().refreshRate = 1; this._scene.render(); this._shadowGenerator.getShadowMap().refreshRate = 0; } else { this._scene.render(); } Is this a problem i this case? I just want to know (maybe it's a bug). Shouldn't ShadowGenerator check the Mesh.isDisposed attribute? Have a nice day Kevin
  7. Hello, I've been following a Phaser spring example and I've been trying to remove the overlay sprite it draws on my circular physics body (I assume it adds this when I call body.setCircle(5)). Does anyone know how to remove this? I don't want to remove the body, I still want the physics, I just don't want the extra debug drawn sprite. Thanks
  8. Hi there, I want to know if there is a way to remove from Phaser, completely the use of localStorage, I'm working on a google Ad and Double Click Studio does not support this feature, and also I'm not using it, so I want to remove from the engine, someone knows if this could be possible. Regards.
  9. I'm trying to remove sprites from a group using destroy() whenever the sprite goes out of the world bounds, but I'm getting an unexpected error: Cannot read property 'world' of null. Any idea why this is happening? function create() { buildings = game.add.group() var building = buildings.create(0, 0, 'building') building.body.velocity.y += 90 building.events.onOutOfBounds.add(onBuildingOutOfBounds, this)}function onBuildingOutOfBounds(building) { building.destroy() console.log(buildings.length)}
  10. In one state I'm using Phaser.RenderTexture, game.make.bitmapData and they reduce framerate in the next state. Is there a way to get rid of them completely? 1) I'm switching the state. 2) Using .destroy() for bitmapData, RenderTexture and sprite which uses RenderTexture. What else can be done? Remove them from cache? Thanks in advance. P.S. using CANVAS mode
  11. When trying to clean up my stage on game over, I loop through my game object groups and destroy all children inside explicitly. Then I destroy the (now empty) groups: cleanGroup(Grp1); // Grp1 is child of Stage groupcleanGroup(Grp2); // Grp2 is child of Stage groupcleanGroup(Grp3), // Grp3 is child of Stage groupcleanGroup(Stage);var cleanGroup = function(Grp) { if (Grp.children) { while (Grp.children.length) Grp.removeChildAt(0).destroy(); } Grp.destroy(); }However, this always gives me a hole bunch of error messages like: this.children is null this.parent is null o is null The error messages are constantly repeating as if it where within a loop anywhere inside the Pixi render enginge. Why is this and how could this be solved? Do I need to destroy my created sprites and groups at all or is it enough just to remove all of my references to them and let the garbage collection do the rest? Would this be reliable?
  12. Hello, I noticed that events attached on bitmapText objects tend to linger/persist even after the item has been removed/destroyed from the group or even after the group has been destroyed. Does anyone have any idea why is this happening? or how to solve this? I'm attaching the event like this text.inputEnabled = true;text.events.onInputDown.add(fn, this);Thanks!
  13. Hi I am currently writing a game, but I have noticed that it is pushing the processor to the max. Previous discussions would suggest that it can be a problem with the browser, however I think I have too much going on at the same time. I have created a version of Asteroids, so as you can imagine there a lot of collisions, which from my understanding can cause the processor to work hard. My question is, I am currently using Destroy() when the asteroids are hit, would I be better off using Kill() instead? What would also be the most efficient way to recycle the asteroids? collisionHandler: function (bullet, asteroid) { //get asteroid.kill type and position var asteroidKey = asteroid.key.toString(); var asteroidX = asteroid.position.x; var asteroidY = asteroid.position.y; // When a bullet hits an asteroid we kill them both bullet.kill(); asteroid.destroy(); ... The game can be played at http://tjs_uk.bitbucket.org I intend to reduce the amount of code, now that it is working (and I have a better understanding of the Phaser... sort of??) Thanks in advance. Trev.
  14. I've been trying to extend the functionality of TweenManager, so it can resume and pause everything within a group. I adapted the code from here: http://jsfiddle.net/lewster32/L3u3gp5k/ http://docs.phaser.io/TweenManager.js.html#sunlight-1-line-127 When debugging with console, _tweens and _add are undefined for each object, so the function doesn't work. I think the code is correct? Any ideas why this isn't working? I'm guessing i've missed something crucial about _tweens. Here's the code: (This goes out to Rich and Lewster) Phaser.TweenManager.prototype.pauseAllFrom = function(obj, children) {console.log('pauseAllFrom', obj.type, obj.name, obj._tweens, obj._add); var o, c, t, len; if (Array.isArray(obj) ) { for (o = 0, len = obj.length; o < len; o++) { this.pauseFrom(obj[o]); } } else if ( (obj.type === Phaser.GROUP || obj.type==7) && children){ for (c = 0, len = obj.children.length; c < len; c++){ this.pauseFrom(obj.children[c]); } } else { for (t = 0, len = this._tweens.length; t < len; t++){ if (obj === this._tweens[t]._object){ console.log('pauseFrom _tweens:',this._tweens[t]); this._tweens[t].pause(); } } for (t = 0, len = this._add.length; t < len; t++){ if (obj === this._add[t]._object){ console.log('pauseFrom _add:',this._add[t]); this._add[t].pause(); } } }};Phaser.TweenManager.prototype.resumeAllFrom = function(obj, children) {console.log('resumeAllFrom', obj.type, obj.name, obj._tweens, obj._add); var o, c, t, len; if (Array.isArray(obj) ) { for (o = 0, len = obj.length; o < len; o++) { this.pauseFrom(obj[o]); } } else if ( (obj.type === Phaser.GROUP || obj.type==7) && children){ for (c = 0, len = obj.children.length; c < len; c++){ this.pauseFrom(obj.children[c]); } } else { for (t = 0, len = this._tweens.length; t < len; t++){ if (obj === this._tweens[t]._object){ this._tweens[t].resume(); } } for (t = 0, len = this._add.length; t < len; t++){ if (obj === this._add[t]._object){ this._add[t].resume(); } } }};I also had to add a condition for the object type, as the console wasn't recognising Phaser.GROUP, and spitting out a number for each object type. // from thiselse if (obj.type === Phaser.GROUP && children){// to thiselse if ( (obj.type === Phaser.GROUP || obj.type==7) && children){Any help would be greatly appreciated. Thanks
  15. Hi, i tried to make a game with a pause menu but, i only success to supress resume button (not the restart or the menu button) when i click on it. I've tried with remove child and remove but it's don't work. RestartButton =game.Class.extend({ init:function(){ this.sprite = new game.Sprite('run'); this.sprite.interactive = true; this.sprite.mousedown= this.sprite.tap = function() { game.scene.stage.pausedGame=false; this.remove(); //Need Help here }; this.restartChoice = new game.Text("Restart", {font: '40px wallfont',fill: "#ffffff",align: "center"}); this.restartChoice.position = {x: 30, y:120}; this.restartChoice.interactive = true; this.restartChoice.click = this.restartChoice.tap = function () { game.system.setScene(TestGame, true); }; this.menu = new game.Text("Menu", {font: '40px wallfont', fill: "#ffffff", align: "center"}); this.menu.position = {x: 30, y: 160}; this.menu.interactive = true; this.menu.click = this.menu.tap = function () { game.system.setScene(MenuGame, true); }; }, displayButton:function() { this.sprite.position.x=5; this.sprite.position.y=50; game.scene.stage.addChild(this.sprite); game.scene.addObject(this.sprite); game.scene.stage.addChild(this.restartChoice); game.scene.addObject(this.sprite); game.scene.stage.addChild(this.menu); game.scene.addObject(this.sprite); }});
  16. Hi! So here's something that has been bothering me for a while... Can we somehow "unload" textures/texture atlases/assets? I'm working on a game that has multiple levels. At the start of each level, I preload all of the assets the level requires using the AssetLoader. So at the start of the first level I have something like: loader = new PIXI.AssetLoader(["level1_assets.json"]);loader.onComplete = startLevelloader.load();While at the start of the second level I have something like: loader = new PIXI.AssetLoader(["level2_assets.json"]);loader.onComplete = startLevelloader.load();The point is, once the first level is over, I will never again need the texture atlas used to store its assets (resp. "level1_assets.json"). So there's no need for it to linger in my precious GPU memory anymore! Can I somehow dispose of it?
  17. Hi, I've been making my first game in Phaser (using Phaser 2.0.3) and have been looking to ensure that some sounds are garbage collected when they are no longer in use. I was hoping to use Sound.destroy to do so (which I think is a new feature to Phaser 2.0.3)/ However, when I call Sound.destroy, I am getting the following error (as pasted below from Chrome's console): I get the same error in all browsers tested (Chrome and Firefox). Has anyone else encountered this issue? Thanks!
  18. Hello, I'm trying to make a strategy tiled-based game, where each tile can be terrain or building (eg. road, meadow, forrest, road, farm, barracks, woodcutter hut etc.) I want to create a user interface, where player would have various tools e.g. "build", "bulldoze/destroy" so that he/she could change the landscape of the game and create buildings etc.. Technicaly - to put new tiles on map I'm using map.putTile. And this works OK. But... How can I remove a tile? The problem is I don't see in TileMap an option to remove tiles, so I started wondering: am I doing it wrong? Should I use TileMap to create objects like farm or road that can be destroyed during gameplay? Or maybe there is a way to remove an individual tile from map?
×
×
  • Create New...