Jump to content

Search the Community

Showing results for tags 'clear'.

  • 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 8 results

  1. I'm using BabylonJS within an Angular application. It is used in a Dialog and shows three dice that are falling. The first time I open the dialog everything looks fine. However, if I close the dialog and reopen it, the 3D scene is empty. I suspect it has something to do with the engine/scene not being cleared, but I have to little experience with WebGL and BabylonJS to make a good guess on how to solve it. On Close, I do call public cleanup(): void { this._engine.stopRenderLoop(); this._scene.dispose(); this._engine.dispose(); } Sadly, this does not solve the problem. If anyone can help me out, I'll be much obliged.:-) The project can be viewed on github: https://github.com/gurpsdomain/GurpsyMcGurpsFace The BabylonJS code can be found in src/app/presentation/dialoges/generic/dice-dialog/scene And a running example is available on https://gurpsdomain.github.io/GurpsyMcGurpsFace/ Click on the menu icon (top right) and select "Throw Dice". Thanks! Meron
  2. Hello, I'm trying to render a crystal clear plastic object with really bad results. I need the render to be realistic and close as possible to the real one (see attached pics). Any suggestion or examples?
  3. Hi! I'm wondering is it posible in PIXI to erase some area of Graphics object? Something similar to canvas clearRect() method.
  4. Hi everyone I'm trying to change the same meshes values to a new one. The problem that the old instance is still rendered in the scene over the new one. Is there is a way to clean the canvas or the sean or to clean the old meshes state ?
  5. I'm seeing a massive performance hit from BitmapData.clear(). I've also noticed it eats up memory. I looked at the source code and the bottleneck appears to be from setting the dirty flag to true. If I use BitmapData.context.clearRect() manually, everything works fine. What is the dirty flag doing? Why is it necessary to set it? Perhaps an argument could be added to skip setting it?
  6. Hi peeps, posted this in the Common Phaser & CocoonJS issues topic as well, but no answer as of yet. This is what's keeping me from finishing the game pretty much so felt like I had to make it it's own topic as well. I've been having some struggles with memory as of late. At first I loaded everything in preload.js which worked fine in my other smaller games, and I use shutdown() for the first time and clear every object when leaving a state which certainly makes the game smoother. But then when making my third world for the game I recieved memory warnings. So I decided to load the necessary parts of each world in their preload-functions, now the problem I'm having is removing them when entering a new one. Say when I'm done with world 1 and enter world 2, I want to clear the loaded assets only used in world 1. I've tried cache.removeImage(key), which alone did not quite work as I'd like, since it doesn't quite clear it right away. Then I've read about cocoons feature .dispose() which I then tried like this: cache.getImage(key).dispose() cache.removeImage(key) I've tried in some other orders too, and a little with PIXI(but since that's part of removeImage I didn't look that much into it), but long story short(er); what's the best way to clear assets from memory, using cocoon and phaser, since I want to load them every time I enter each world. I don't want to do it in an incomplete way like I did with removing objects from states before. Cheers!
  7. Hi, I'm new to Phaser and that just got the problem with graphics object. What I want to do is display a bar of "energy" so that when I press the SPACEBAR keyboard the energy bar will be fulfilled until the key is released. In addition I want to tracking the previous charged energy so when the key was released I will fulfilled the energy bar with the graphic alpha is 0.5. Please look at below: The tracking energy is clear that I don't know why, because I think I draw right after I clear all. This doesn't work until I try to put the debugger and open the developer tool (in Chrome). You can try yourself to see that. Thank var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { create: create, update: update }); var spaceButton; var currentEnergy = 0; var MAX_ENERGY = 500; var chargingEnergyGraphic; var previousChargingEnergyGraphic; function create() { chargingEnergyGraphic = game.add.graphics(0, 0); previousChargingEnergyGraphic = game.add.graphics(0, 0); var graphics = game.add.graphics(0, 0); graphics.lineStyle(2, 0xFF0000, 1); graphics.drawRect(50, 50, 500, 20); spaceButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); } function update() { if (spaceButton.isDown && currentEnergy <= MAX_ENERGY) { currentEnergy += 10; chargingEnergyGraphic.clear(); chargingEnergyGraphic.beginFill(0xFF0000); chargingEnergyGraphic.lineStyle(2, 0xFF0000, 1); chargingEnergyGraphic.drawRect(50, 50, currentEnergy, 20); chargingEnergyGraphic.endFill(); } if (spaceButton.justReleased()) { trackPreviousEnergy(); } } function trackPreviousEnergy() { debugger; chargingEnergyGraphic.clear(); previousChargingEnergyGraphic.clear(); previousChargingEnergyGraphic.alpha = 0.5; previousChargingEnergyGraphic.beginFill(0xFF0000); previousChargingEnergyGraphic.drawRect(50, 50, currentEnergy, 20); previousChargingEnergyGraphic.endFill(); currentEnergy = 0; }
  8. Hello community, I'm in need of help with something on my project. I need do draw a new scene in the same scene stuck in a while loop (while the option exit isn't pressed). By that I mean, that i would like to clear the all screen when this function is started, then, when exit is pressed, the "state machine" would come back to the main scene. I'm not beeing able to find any function to do this. Any suggestions ? Thanks in advance,
×
×
  • Create New...