Jump to content

Search the Community

Showing results for tags 'children'.

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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

  1. I am trying to get all the children of a container displayed inside a zone. var container = this.add.container(200, 200); var sprite0 = this.add.sprite(0, 0, 'box'); var sprite1 = this.add.sprite(0, 100, 'box'); container.add([ sprite0, sprite1 ]); var graphics = this.add.graphics(); var color = 0x00ffff; var thickness = 2; var alpha = 1; graphics.lineStyle(thickness, color, alpha); graphics.strokeRect(32, 32, 256, 256); graphics.fillStyle(color, 0); graphics.fillRect(32, 32, 256, 256); container.mask = new Phaser.Display.Masks.Geome
  2. I have an invisible mesh that is the parent of a few child boxes, ordered horizontally one near the other. I'm using the following line to figure out the size of a mesh: getBoundingInfo().boundingBox.extendSize.scale(2) When called on each of the child boxes, the vector returned is correct. When called on the parent mesh, (0, 0, 0) is returned. Is there a way to get the size of the parent, taking into account all of its children?
  3. Hello, I have a mesh (an airplane) which needs to be cloned 20 times - and then all 20 clones require their propeller to animate at different speeds and times. How do I identify each propeller or assign a variable (preferably a slot in a "propeller" array) to each cloned propeller to animate - once again animate separately. When I clone each airplane, how do I know the name of each child on the parent mesh, and animate it's children such as the propellers? How do I assign a unique name to each one? Once I have a unique name or variable assigned to each, then I can animate each one separat
  4. Hi, I have a button in my game which has two child elements(a text aligned top center in and another text aligned bottom center). The issue is the child texts are also taking click of the button which should not happen. Here is the code for this: Fiddle : https://jsfiddle.net/3sf1b2zL/18/ var game = new Phaser.Game(480,320,Phaser.AUTO,''); var gameStates = {}; gameStates.Main = function(game){}; gameStates.Main.prototype = { preload: function() { this.load.crossOrigin = "Anonymous"; this.load.image('shop','https://s1.postimg.org/6fz3duzc0r/user_input_
  5. I'm fairly new to pixi.js and programming altogether. I am making a plugin that parses the xml save file of a sprite animation program and recreates the result in a game engine. The animation program uses bones for skeletal animations and the images (sprite parts) inherit the x, y, angle, scale_x, scale_y of the parent bone. The main idea would be to create sprites for the bones and the images, set up the bone inheritance to make the skeleton animation work correctly and then addChild the image sprites to the respective bone sprites. The only problem is that along with the afore
  6. hi all, i'm trying to calculate the boundingbox of a parent mesh, so that i may get a good camera asprect. but failed to get the boundingbox size of the parent. are there any tricks there? pg http://www.babylonjs-playground.com/#QVIDL9 // Our built-in 'sphere' shape. Params: name, subdivs, size, scene var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene); // Move the sphere upward 1/2 its height sphere.position.y = 1; // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene var ground = BABYLON.Mesh.CreateGround("groun
  7. Hi, Don't know if this is intended behavior but ActionManager executes actions on disabled meshes too. Don't want it run on disabled meshes. Also actions registered with a parent mesh are not executed by children. Got children to execute parent action by registering action to each end child. For meshes disposed/created actionManager to toggle action execution when they are disabled/enabled. So found a way around both, if anyone is looking for it. If there is a better way, please tell. Would love to see ActionManager handle this internally. Thankyou And yeah pg: http:
  8. Hello all I am pretty new to Phaser. Now I am testing to create drag and drop shape game. I use this code : var background = game.add.sprite(0, 0, 'atlas', 'background.png'); var shape = game.add.sprite(0, 0, 'atlas_test'); shape.frameName = 'ellipse.png' ; shape.inputEnabled = true; shape.input.enableDrag(); In short, this works fine, I drag with my mouse, and it follows my mouse pointer location. But problem happens when I add this : background.addChild(shape); When I add the draggable shape into background, somehow the draggable shape is several x and y away from th
  9. tl;dr when I move parent, child position is updated too late, how to manually force to update child position when I move parent? Hello, in my game I have a group of sprite objects (Ships) this.shipsGroup = game.add.group(); Each Ship before adding to this.shipsGroup have two other groups as children : var actualShip = game.add.group(); var surrounding = game.add.group(); for (var m = 0; m < 3; m++) { var temp = game.add.sprite(-halfSize - 50 + l*50, tempy, 'red'); temp.anchor.setTo(0,1); tempy+=50; if(m == 1 && l > 0 && l < ship.unitS
  10. Hi guys, I was trying to make a group of objects and got the following error: phaser.js:45776 Uncaught TypeError: Cannot read property 'length' of undefined Everything seems to be fine, anyone has a clue why this might be happening? FYI: I'm using Phaser 2.5.0 Thank you for your help.
  11. When transform is added to parent, it's also added to children right? In some case I don't want this - I want to control my self, how children reacts when parent transform is changed. Can I do that? Any advice?
  12. Hi i need some help with my school assignment so what i want to do is to kill the children at the same time if all the children's y position more than 820. or if i can check all the position of the children or the group ( i dont think that possible). animals.forEach(function(animal) { var z=0; if (animal.y > 820) { z++; console.log(z); } if (z>6) {animal.kill();} } ); the number of the children is 5 and the problem is the number of z is always 1 therefor the animal.kill() never been process. thought?? or do you
  13. Hello, this is my first time developing a game, ever. So please bear with me Currently I'm making a game where a player can shoot bullets at enemies. Each enemy has it's own healthbar, which should decrease when a bullet hits the enemy. For now, implemented the healthbars as a spritesheet with 5 different frames and added them as children to the enemies. function create() { enemies = game.add.group(); game.physics.arcade.enable(enemies); enemies.physicsBodyType = Phaser.Physics.ARCADE; enemies.enableBody = true; bars = game.add.group(); for (var i = 0; i < 5; i++) {
  14. Is there a way to set the visibility of a mesh to false and have all of it's child meshes be affected as well? I'm setting the children using .parent = parentMesh. Currently it seems that the only way is to loop through all of the children manually. The major problem with this approach is when you have children of children of children. Here is a PG to demonstrate. Uncomment the comment block. http://www.babylonjs-playground.com/#17IGZF#0 var materialSphere = new BABYLON.StandardMaterial("texture2", scene); materialSphere.diffuseColor = new BABYLON.Color3(1, 0, 0); //Red materialSphe
  15. Hi all, I build simple word match game: http://woa.troinof.ru/ If you play game you can see that elements not always disappear, for some reason after selected element removed and other moved down his children element disappear: and must be: It happends after letter moves. Bug step by step: Step 1: Step 2 (all good): Step 3 ( repeat step 2): Result step 3 ( FAIL ): I dont't understand where i made mistake. Fanks for attention:
  16. Is it possible to create a group and configure in such a way that any child with position (0, 0) would be the center of the group instead of its top left corner? As I add bigger sprites to the group and its size increases, things get misaligned. The manual solution seems to involve re-adjusting the positions of the object in the group every time I add/remove something to it, which is kinda ugly.
  17. Hello, i'd like to know if there's any way to determine if a certain sprite is part of a certain group. More specifically, if i can check for collision between sprite and group, and make sure the sprite is colliding with another sprite that's part of a certain group. Thanks in advance.
  18. Learn numbers and counting. Now learning is so fun earn points with right answers but be careful every wrong answer will teke your points. Find hidden rabbits and give right answer every time. See the rabbits in action
  19. Hello, just want to know if this behavior is expected: when you set a Billboard mode to a mesh with a parent then the child mesh won't inherit scaling: http://www.babylonjs-playground.com/#1JSXHW Is there any way to avoid that? (other than changing the scaling to the child too)
  20. 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 i
  21. I just noticed that changing the alpha value of a Container() does not affect any children within (actually, it does nothing). You have to set the alpha of each sprite within explicitly (which is really tedious). Why is that?
  22. We have just released a new game! COLORING BOOK: ANIMALS Take a look and tell us if you like it! http://codecanyon.net/item/html5-coloring-book-animals-html5-game/11814296 High quality Graphics Optimized for mobile and desktop Code sources included Highly customizable Take a look also at our portfolio http://www.codethislab.com/?p=services&s=games
  23. We Are Bionic is a creative digital studio looking to add fresh talent to our development team. Firmly established within the youth entertainment space, the studio works with organisations such as BBC, Channel5, Entertainment One and Disney delivering exciting browser based game experiences supporting TV brands. This role offers the opportunity for someone who has a real HTML5 game dev passion but wants the ability to be part of a small team helping to create fresh thinking around HTML5 gaming and drive the growth of the studio. The studio is based in South West London. If you are interested
  24. Hi there, In the "group" tutorial (http://mightyfingers.com/tutorials/display/group/) it seems super easy to acces group elements, but for me it doesn't work. I have a simple project here: http://mightyeditor.mightyfingers.com/#p266r If you look in the play.js you can see the code. It's basically like this: this.playScreen = mt.create("Game"); // create Game Group this.gPig = this.playScreen.Pig; // but cannot get the children console.log("pig:" + this.gPig); // undefined - But Why? Any advise what the problem might be?
  25. I am using the Actions Manager and am trying to use the OnIntersectionEnterTrigger on a (child) mesh that has a parent, but seems to be firing on the parent mesh? Is this the right behavior? The mesh I would like for it to fire on is smaller than the overall parent mesh. Thanks.
×
×
  • Create New...