Search the Community

Showing results for tags 'solved'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 1639 results

  1. Hello pixijs forum and devs. Iยดm currently working on a multiplayer 2d Game. Problem: I'm using pivot for main game scene to follow the Player (in center) everything works okay when i have resolution at 1. -- Thanks for every reply, my english is not very well so ill try to explain throu the photos &code I'll attach some photos to show u my problem PIXIJS Inspector: - Pivot point does not scale properly with resolution. My code for resize and App I have my app declared here as static export class Game { //Create a Pixi Application public static app:any = new PIXI.Application({ antialias: false, // default: false transparent: false, // default: false autoDensity: true, autoResize: true, resolution: window.devicePixelRatio, }); // Resolution & Camera public static WIDTH:number = 728; public static HEIGHT:number = 540; I have own container which contain Game (everything expect UI) dynamic content Game.scene /** Game -> Dynamic container */ public static scene:any = new PIXI.Container(); public static init():void { // Initialize Display.Stage (Layers support) = new PIXI.display.Stage();; Game.resize(); // call resize funct. ....; } // i took those function from Pixi Forum /* Helper function to resize the game to fit the full screen */ public static resize():void { const WIDTH:number = Game.WIDTH; const HEIGHT:number = Game.HEIGHT; const vpw:number = window.innerWidth; // Width of the viewport const vph:number = window.innerHeight; // Height of the viewport let nvw:number; // New game width let nvh:number; // New game height // The aspect ratio is the ratio of the screen's sizes in different dimensions. // The height-to-width aspect ratio of the game is HEIGHT / WIDTH. if (vph / vpw < HEIGHT / WIDTH) { // If height-to-width ratio of the viewport is less than the height-to-width ratio // of the game, then the height will be equal to the height of the viewport, and // the width will be scaled. nvh = vph; nvw = (nvh * WIDTH) / HEIGHT; } else { // In the else case, the opposite is happening. nvw = vpw; nvh = (nvw * HEIGHT) / WIDTH; } // Set the game screen size to the new values. // This command only makes the screen bigger --- it does not scale the contents of the Game. // There will be a lot of extra room --- or missing room --- if we don't scale the scene., vph); // This command scales the scene to fit the new size of the Game. let zoom = Camera.activeCamera ? Camera.activeCamera.zoom : 1; Game.scene.scale.set(zoom * (nvw / WIDTH), zoom * (nvh / HEIGHT)); Game.scene.filterArea = new PIXI.Rectangle(0,0, vpw, vph) } export class Camera { .... public static updateView() { if (Camera.activeCamera) Game.scene.pivot.set(Camera.activeCamera.position.x, Camera.activeCamera.position.y); } public setFocus(obj:any):void { this._cameraFocus = obj.position; } // On Update / GameLoop Camera.activeCamera.setPosition(Camera.activeCamera._cameraFocus.x, Camera.activeCamera._cameraFocus.y); ... } Camera.activeCamera._cameraFocus.x is bounded to (referenced) container position - For some reason pivoting player position (container) is not centering container to the middle if resolution is higher. in PlayerInit i have -- My HTML Viewport is: <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
  2. I want to generate multiple textures from one base texture. The multiple textures would have different color of a specific attribute (skin, shirt, pants, hair..). I looked at one example (, but the bunnies it uses are extracted from the image and not dynamically generated with Pixi... So, how do I generate multiple textures with different color specific attributes with Pixi? Example code would be greatly appreciated.
  3. Hi all, I was wondering if it was possible to access variables from a previous pass in the shader, i.e color of fragment or something along those lines. I want to have something that changes color over time after an event occurs. So if I can access a time delta plus a previous color then I can slowly modify it to a new state, is this possible? *Note this is my first time working with shaders, please excuse any stupid questions ๐Ÿ˜• Thanks.
  4. I must be doing something incorrect with the water, as it is rendering black: I pasted the code from this playground, and included the files for the waterbump.png and skybox: Here's my code, although its very similar to the PG. My guess is the error isn't in this code, though I'm not sure what else would affect the water. It is as if it has nothing in its render list -- but I can definitely see the sky, and the sky is added to the list. this.canvasEle = document.getElementById('main-canvas') this.engine = new BABYLON.Engine(this.canvasEle, true) this.engine.enableOfflineSupport = false this.engine.setHardwareScalingLevel(1) this.scene = new BABYLON.Scene(this.engine) //this.scene.freezeActiveMeshes() //this.scene.collisionsEnabled = true //this.scene.clearColor = new BABYLON.Color4(0.3, 0.5, 0.75, 1.0) this.scene.fogMode = BABYLON.Scene.FOGMODE_EXP this.scene.fogDensity = 0.0005 = new BABYLON.TargetCamera('camera', new BABYLON.Vector3(0, 0.5, 0), this.scene) = 0.8 = 0.1 //this.scene.autoClear = false //this.scene.autoClearDepthAndStencil = false var light = new BABYLON.DirectionalLight("dir01", new BABYLON.Vector3(0.66, -0.75, 1.25), this.scene) light.position = new BABYLON.Vector3(1, 40, 10) light.intensity = 0.5 var light3 = new BABYLON.DirectionalLight("dir01", new BABYLON.Vector3(-0.5, 0.75, -1.25), this.scene) light3.position = new BABYLON.Vector3(1, 40, 1) light3.intensity = 0.5 var light2 = new BABYLON.HemisphericLight('h', new BABYLON.Vector3(0, 1, 0), this.scene) light2.intensity = 0.6 var skybox = BABYLON.Mesh.CreateBox("skyBox", 5000.0, this.scene) var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", this.scene) skyboxMaterial.backFaceCulling = false skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("images/TropicalSunnyDay", this.scene) skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0) skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0) skyboxMaterial.disableLighting = true skybox.material = skyboxMaterial var waterMesh = BABYLON.Mesh.CreateGround("waterMesh", 2048, 2048, 16, this.scene, false) var water = new BABYLON.WaterMaterial("water", this.scene, new BABYLON.Vector2(512, 512)) water.backFaceCulling = true water.bumpTexture = new BABYLON.Texture("images/waterbump.png", this.scene) water.windForce = -10 water.waveHeight = 1.7 water.bumpHeight = 0.1 water.windDirection = new BABYLON.Vector2(1, 1) water.waterColor = new BABYLON.Color3(0, 0, 221 / 255) water.colorBlendFactor = 0.0 water.addToRenderList(skybox) waterMesh.material = water Any ideas?
  5. I'm trying to get post process working on a project that also should run in VR, but unfortunately things break as soon as I add the scene.createDefaultVRExperience() to the project. This happens even if VR is not activated yet. Is there any way to use post process and VR together? Here is an playground highlighting the issue: (just uncomment line 9) Thanks!
  6. Hi, I would like to create an environment with several objects (in the playground, 2 objects) that cannot be at the same position at the same time (cannot be superimposed). I used the moveWithCollisions method for the Mesh objects, and while it works as expected, when two objects collide and the ellipsoids around them are not identical in size, one of the objects goes to the top or to the bottom of the other. I would like for them to just stay in the same vertical position, and if they collide, simply prevent them from moving, not moving to the top or to the bottom of the other object. Is there any thing you recommend? Playground: If you move the red object towards the purple one, when they contact, the red object moves to the top of the purple one, and I would like them to stay one next to the other. Thanks!
  7. Hello, I am trying to access the absolute positions of meshes inside a GLTF scene. But for all the meshes getAbsolutePosition() always returns 0,0,0. I tried several things (computeWorldMatrix, etc.) but it did not help. What am I doing wrong? Playground Link: Thank you in advance
  8. Hello everyone, I have a strange problem with waterMaterial in my scene, its hard to reproduce it in a playground so here are images : The problem is that the reflection part of the water becomes suddenly opaque. The ground becomes no more visible at some frontier (along x axis on this image). I made a video to make it more clear, focus on the transparency of the water : babylonjs.webm I don't know how to fix this ๐Ÿ˜• Any idea ?
  9. Hello everybody, I'm looking fore some advice using a PS4 (DS4) Contoller for mobiles. So far I've found at least one PLAYGROUND where the camera zoom is responding to my Controller keys. But I have no idea which type of WebVRController is instantiated and how the key-mapping happens (I'm not fit in debugging mobile applications) . Maybe there is one specific WebVRController already implemented or is the Generic type the right one? Does someone have experience with this topic? My hardware conection: Dualshock controller (DS4) paired with an android mobile. Thanks in advance
  10. Hey everyone, I was wondering is there a way to fill a gui image? What i mean by fill is if i set fill horizontal and 50% half of the image would be gone. something like this playground however gui and not textures/shaders: edit: it does not need to have the fade effect like this shaders.
  11. Header text does not start after the checkbox but on it. If we check a box, it comes back to normal.
  12. Hi everybody, I would like to create an virtual visit in several rooms to show arts realisations. I've beginning but I don't know if I use good option. My first trie is to use layermask to switch between rooms. But I suppose that it's possible with better solution. Or it's better to just use visibility mesh property. I didn't find in forum or playground, exemples to do that... Perhaps it's possible to switch scene directly, or unload/reload objects of the rooms. If you have an idear how make better, thank you by advance.
  13. I'm trying to animate the scaling of a plane, but that doesn't seem to be possible? Am I doing something wrong here?
  14. Hi, im having a problem with the material of a Ribbon Mesh when im in wireframe mode, it appears in black all. It should be modified because it is changing the color of the mesh with colorKing, heres an example but in my code all mesh is black. In the playground, if you take a look of the sides, it has color. In my example it doesnt Help me out ๐Ÿ˜ƒ
  15. I explain the problem: I record a first camera position in a variable. Then I move the camera to compare in the state the new position of the camera and the variable in the old position. The problem is that the variable is reassigned in real time when the camera is moving, which I find very strange. The variable should not be changed. See in this PG and the console. Click once on the button to save the variable. Then move the camera, the variable changes all alone. So at the second click on the button, the alert is never reached, because the variable has the same value as the new position of the camera, while the record was made on an old camera position. If we look at this PG more simple, it's the same thing : It's something I saw a long time ago, but that did not bother me, but here I can not record a camera position to compare it to a new position without the variable being rewritten by the Holy Spirit, LOL. [Edite] : This does not seem to be related to Chrome 71. I have tried FireFox and Opera too and it's the same thing. So I think that the Babylon reassigns the variables that it has to assign, maybe the light as well as something else in Babylon reassigns the variables that it has to assign. I will check it Yes, the lights too. As soon as the light is moved, it rewritten the variable that it has assigned previously. I think that all entities in Babylon are rewritten the variables automatically. So currently, we can no longer record transformations (position, rotation, scale and other modifications) in a variable to preserve previous states and compare them with new transformations. This is a big problem for the editor that one develops
  16. Hello, I'm doing tests with playfab, when I use the LoginWithFacebookInstantGamesId in the postman program I get this error: I also included it in my project to see if it was something from the postman and it gives me an error of the CORS. This is the code I use to get the Facebook Instant Games Signature
  17. Hi, Hey in fact there are problems in MANY GUI ELEMENTS, "text box", buttons, etc!!!
  18. Hi, I am looking for a solution to achieve some kind of 'shared' transparency for parent and child meshes. Here is my simple playground The idea is to make both boxes be transparent against the ground (and other meshes) but not transparent to themselves. Please see the picture below. Can you help me with this? Thanks for your kindness.
  19. On my project the buttons (BABYLON.GUI.Button.CreateSimpleButton(null, "Fixer cette vue");) do not show the text totally. I am forced to point to any GUI element so that the text of the button is completely displayed. It is possible that this problem is not on that the buttons. But if a text has more than one word, every word goes to the line. The button text that this gets is "cette" instead of "Fixer cette vue". Move the mouse over the button (cursorHover) and this is normal text ("Fixer cette vue") . Repeat play and another parentElement error happens After when I go on the playground I get this error : cannot read property 'parentElement' of undefined
  20. Hi Can I somehow make distance for LODs to count from the target position of ArcRotateCamera? I'm making sort of map application and when I tilt the camera down, visible meshes on the map is under the camera and I want them to be where camera is looking
  21. Hello there. What is intended method of playing the same sound multiple times *concurrently* without re-downloading the sound file from the server? const gunshot = new BABYLON.Sound('foo', "sounds/gun_semi_etc.wav", scene, null, { volume: 1 }) If I have multiple players or bots in my game, any of them can produce gunfire. As each of them shoots, I end up with a separate web request per entity: I'm accustomed to howler, where the first time a sound is created, like 'foo.wav' it will load it from the server. Any subsequent sound objects created that play 'foo.wav' will build themselves from the same sound data without an xhr. How do I accomplish the equivalent? TY TY
  22. Hello there! I been trying to load my gltf model from it's raw data source, is there anything i might be doing wrong here, the model shows in the sandbox though
  23. I have an arc camera attached and have removed the mousewheel zooming from it. Instead I've intercepted the mousewheel event and I'm trying to scale all of the particles via the parent mesh so that the scene stays the same, but the particles all zoom in / out. Before sps.setParticles is called I update the mesh property scalingDeterminant to try and zoom it, but I'm not seeing any effect. I may be doing this completely the wrong way but can't find anyone else scaling the mesh after initialisation (I'm doing it this way to avoid enumerating the particles as I thought it might be more efficient). I've modded a project in the playground so you can see what I'm trying -> Any advice for a noob? Thanks in advance Ryan
  24. Hi, Hope I'm clear with my explanation: I have a Babylon scene and when it is alone (no other div on the html that has the canvas) the OnPointerOverTrigger works perfectly. However, when I put the canvas inside a <div> the OnPointerOverTrigger seems shifted, I mean, when I hover over the mouse over the mesh the action starts outside the mesh. I need the scene to be inside a div as I'm using w2ui as the GUI interface of the application. Attached one example: camera.html and cameraGood.html camera.html is the one with the issue, it only adds these lines: <div> <h2>Title</h2> </div> <div> <canvas id="renderCanvas" touch-action="none"></canvas> </div> cameraGood.html has no divs <canvas id="renderCanvas" touch-action="none"></canvas> I create a sphere every time you click on the surface. Without the div it works great, but when I add a div for a title and another for the canvas it fails, it picks another position. It seems the mouse coordinates are being used for the complete web browser and not the canvas. Any recommendation? camera.html cameraGood.html
  25. From the version of the Blender exporter that deltaKosh wrote, the value for specular hardness was designated as the value for specularPower. This has to change for processing Cycles nodes, without baking. Ignoring the principled shader for now, this value now has an analog in the roughness value of a Glossy node. Problem is this is a value from 0 to 1. Also a value of 0 is shiniest while 1 is dullest. The default value is 64. MakeHuman imports to Blender change based on the render currently assigned. The eye mesh is the glossiest. When using the internal render the hardness is 500. Roughness in cycles is 0. Does a range of 500 (0) to 64 (1) make sense? There is very little in the way of documentation for this.