Leaderboard


Popular Content

Showing content with the highest reputation on 04/28/15 in all areas

  1. 2 points
    Jaskar

    Babylon Projects

    Rubik's cube player / solver : http://www.jaskar.host-ed.me/BabyksCube/
  2. 2 points
    NasimiAsl

    Babylon Projects

    eash : shader base scene http://eash.space/scene/index?scene_vp8 thanke for visiting
  3. 1 point
    Sturb

    Toggle Button

    So I made a toggle button that extends Phaser.Button. Figure I would share it seeing as I couldn't find any other implementation of something similar (if I missed something, then I'm sorry). I wrote this in Typescript and am posting that code. The Javascript is ugly because it's auto generated. It shouldn't be too hard to convert. Possibly something that could go in the engine itself. /** * Class ToggleButton */export class ToggleButton extends Phaser.Button { /* Member Variables */ toggle: Phaser.Image; toggled: boolean; toggleSignal: Phaser.Signal; constructor(game: Phaser.Game, toggled?: boolean, xx?: number, yy?: number, toggleX?: number, toggleY?: number, key?: string, callback?: Function, callbackContext?: any, toggleKey?: string|number, overFrame?: string|number, outFrame?: string|number, downFrame?: string|number, upFrame?: string|number) { super(game, xx, yy, key, this.onClick.bind(this), callbackContext, overFrame, outFrame, downFrame, upFrame); // Set up the toggle signal. this.toggleSignal = new Phaser.Signal(); // Set the callbacks for each toggle state. callback ? this.toggleSignal.add(callback, callbackContext) : { }; // Set the initial toggle state. this.toggled = toggled || false; // Create and add the toggle image. this.toggle = game.make.image(toggleX, toggleY, key, toggleKey); this.addChild(this.toggle); // Set the initial state of the toggle image. this.toggle.visible = this.toggled; } /** * ToggleButton::onClick. Callback for when the toggle button is clicked. */ onClick() { // Set the state of the toggle. this.toggled = !this.toggled; // Set the state of the toggle image. this.toggle.visible = this.toggled; // Fire the toggle signal. this.toggleSignal.dispatch(this.toggled) } /** * ToggleButton::destroy. Destroys the toggle button. */ destroy() { // Destroy the toggle image. this.removeChild(this.toggle); this.toggle.destroy(); this.toggle = null; // Destroy the toggle signal. this.toggleSignal.removeAll(); this.toggleSignal.dispose(); this.toggleSignal = null; // Destroy the Phaser.Button object. super.destroy(); }}The destroy override might be wrong. There might be a better way to destroy those components.
  4. 1 point
    Think I can use the freeze and enabled for the meshes not on the top of the stack. Also, started merging meshes. That also massively reduced not only this, but removed 700+ draws. I am sure things will be really fast! Consuming more memory, but you cannot have everything.
  5. 1 point
    MichaelD

    Toggle Button

    Thanks any extra UI elements are always welcome!
  6. 1 point
    IDB is indexDataBase, eg. data stored in the "application cache" of your browser (nothing to do with the browsing temp files). You can use the dev tools in most browsers to check the content, and to empty it you just have to follow instructions on the internet regarding the browser you're using.
  7. 1 point
    Don't use this polyfill, pixi ships with one already. Just use requestAnimationFrame as if it exists and we will take care of it. We broke only a few things (that is what a major version is by the way), and the few things we did break we wrote extra code to tell you about it. You are experiencing one of those messages. It clearly tells you what the error is, and how to upgrade for v3. What are you stuck on? In v3, there is a brand-new loader. You can create one yourself with "new PIXI.loaders.Loader()" or use the premade one we have for you at "PIXI.loader".
  8. 1 point
    xerver

    scale.x and scaleX, specificially for GSAP

    Nothing stopping anyone from pasting the code above into their project
  9. 1 point
    try PIXI.utils.TextureCache
  10. 1 point
    I develop my game using phaser and node js, how to make it a native application (android and ios) ?
  11. 1 point
    MichaelD

    How to change text color ?

    If you don't want to apply all the properties again you could try: text.addColor("#ff0000", 0); //red
  12. 1 point
    PR submitted.
  13. 1 point
    Okay, I wound up trying these today. First, freezeMatrix is a solid improvement. Here's a scene with a couple thousand meshes (only a few hundred draw calls), which already uses octrees to moderately speed up mesh selection: Here's the same scene after freezing the terrain: So yeah, solid improvement! Very cool. With that said, some thoughts: 1. Would mesh.static:Boolean might be a better name? It would be hard for casual users to guess the implications of "freezeWorldMatrix", but "static" would be pretty straightforward. There might even other optimizations one could do with a mesh that the user has declared to be "static". 2. Could BJS initialize the mesh's world matrix when the freeze API is called? It would be most straightforward if the user can create a mesh, set its position/rotation, and then freeze it, but that doesn't work (I assume because the matrix doesn't get made until the next render). 3. It doesn't work for billboards. I know you already alluded to that but do you think there's any (possibly separate) way that billboarded static meshes could be optimized? I think it's a fairly common use case to have lots of terrain billboards that never move (grass, flowers, etc).
  14. 1 point
    rgk

    Help with online multiplayer collisions

    The key here is to not send the data back to the user controlling the local sprite, and only the other clients. Then both updates of position would overwrite each other. Use excludes.
  15. 1 point
    davrous

    Web Audio loop isn't working in Chrome

    This is indeed not a bug in my code. It works great in Chrome 44 (canary) and Spartan. Most of the time, I'm running into issue with Firefox.
  16. 1 point
    MichaelD

    HUD UI: Best approach

    For the bars you can have one image with colored bar and one without color place them one behind the other and simply change the width of the enabled-colored-bar. For the round ui elements if you want the to rotate from center add element.anchor.setTo(0.5, 0.5) In general I would create a phaser group for each element and add the sub-parts inside that, that way all the elements will be positioned based on their position within the group x=0, y=0 etc. And you will only need to move the group to place it wherever you want. So in the end you will end up with 5-6 groups of elements.
  17. 1 point
    I think the way you create the bounce is not that great because if a frame is somehow skipped your game might break. Why don't you create a material for the player and always keep the bounce set to 1 between the players but to 0 with everything else? If you also have to play a sound for bounce you have two options: -> Send the bounce event from the server (you need to have an authoritative client or server) -> Check somehow if a bounce happened using the players' velocities. If you are not going to have an authoritative server the bounce effect will be really hard to be accurately done by sending only position/velocity.
  18. 1 point
    RaananW

    Render to texture

    A demo of video texture - http://www.babylonjs-playground.com/#EKFLA
  19. 1 point
    Jaskar

    Choosing game engine/framework

    Hi EP, I start building a game with Babylon JS et NodeJS too. (last week-end). If you have times, you can share you adventure with us. You can create a little wip topic like I do with my rubik's cube project Then, we could help you if need, and support you Good luck !
  20. 1 point
    xerver

    v3 loader

    What are you stuck on? A simple example of usage: PIXI.loader // add resources .add('name1', 'url/to/resource1.png') .add('name2', 'url/to/resource2.json') // listen for progress .on('progress', onProgressCallback) // load resources .load(function (loader, resources) { // resources is an object containing the loaded resources, keyed by the names you used above. var sprite = new PIXI.Sprite(resources.name1.texture); });
  21. 1 point
    Neso

    Pixjs game in adobe air web view

    Yes that is true. Making games work in adobe air is possible but it is painful. Few things I've observed. Web view identifies itself as one of the latest browsers but in fact this is not true. There are serious discrepancies between. Native browser and the web view with using native browser flag set to true.Audio will be huge issue, I've ended with disabling it.Audio web api is not available. You have to watch out which stage is in use. You have to use adobe air one. Otherwise, there will be noticeable issues with canvas rendering. Usually only white screen as result.WebGL is not available.Rendering texts that are not bitmap fonts will prove troublesome. And I've noticed performance drops if you are trying to render a lot of them.Overall performance is worst then running the game in native browser on the same device.On iOS everything works fine and game performs more or less as expected. To conclude don't use it unless you have to for some weird reason. And unless you have some legacy software. Cacoonjs is far better option, in regards to options and performance.
  22. 1 point
    NasimiAsl

    Babylon Projects

    new Material for Babylonjs i make new way for easy build material with shader.it is not just for babylonjs i call it "Eash"; i try hard to publish it and make a usefull tools for build a material like v-ray.alpha version is ready in to this month ( estimation time 4/18/2015 -5/1/2015)
  23. 1 point
    highvrahos

    Babylon Projects

    My Glass Studio is a new WebGL application supporting the sales of The-Glass-Co, a global market leader in glass dinnerware construction, active in Greece, Singapore, US and Japan. Active link to the application (login in/register needed): http://myglassstudio.com.gridhosted.co.uk/ Press release: http://www.sevenline.gr/node/169
  24. 1 point
    Temechon

    Babylon Projects

    Hello, I just released a new game called BLOCK here : http://pixelcodr.com/games/block/index.html Move the block with the arrow keys and try to complete all levels !
  25. 1 point
    Hello, I'm experimenting some multiplayer functions with phaser, which I'll share with you if get it working. but I have a question regarding Phaser. when a phaser game lose focus, the simulation stops (game is paused). I assume that this is related to RAF behaviour. but is there a way to continue game state updates and only pause rendering ? so when the game is focused again it directly draws the actual state ? for now, I don't want to do the whole simulation in the server side then synchronize with clients ...etc my goal is to give a simple example on how to start a multiplayer game with phaser.
  26. 1 point
    The property you're looking for is game.stage.disableVisibilityChange - if you set this to true, the game will continue running in the background.