Search the Community
Showing results for tags 'sub'.
-
Hey so I wanted to know how to decide a resolution to render to and then downscale the render; specifically get the user's screen width, *3 and then scale it down to /3 to get a subpixel effect, using 3 times more available pixels (also if probably causing artifacts). I don't even know if this method works so i would really know how to do this/a working method.
-
Hello there, sorry I didn't find any topic (or searched with the wrong words) related to this. So look at the screenshot attached. I have this simple scene with just one mesh. This mesh has submeshes. I also have two hemispheric lights and one directional light. The ground receives shadow. Ok. But the mesh itself always gets black when "receiveShadow" is set to true. I tried bias value, every filter. Other light conditions. Nothing helped. So I always can't figure out what the shadowgenerator wants. How can I achieve that the desk throws shadows on itself? Thanks everyone for help! Kevin
- 15 replies
-
- Self shadowing
- shadow
- (and 5 more)
-
Hello phaser community, I observed some kind of misbehaviour with group nesting. It seems that the reference for the nested group is lost and PIXI.DisplayObjectContainer is exposed instead. Look at the following Testcode. There is a sprite in a group which is added itself to another group. When I try to retrieve the nested group with #getAt it returns a PIXI.DisplayObjectContainer and not the Phaser.Group object. I think this is not an expected behaviour ? I digged that deep because my initial problem was (and still is) that #countDead is not working with nested group items because of this behaviour (It's not iterating over the nested group elements but over the corresponding PIXI Containers., with the lack of the alive attribute). I couldn't find a back reference from DisplayObjectContainer to the Phaser.Group object. With this I could have build a workaround but I couldn't find anything to map PIXI objects to Phaser objects. //create a base group to start withbaseGroup = @game.add.group()//add another nested group (to create the misbehaviour)nestedGroup = @game.add.group()baseGroup.add(nestedGroup)//now create a sprite to have a non-group type to addsprite = @game.add.sprite(0, 0, 'cap');//add it to the nested groupnestedGroup.add(sprite)//Now let's do some testing://output: sprite should be found in child group: expected: (true) is trueconsole.log 'sprite should be found in child group: expected: (true) is', nestedGroup.getAt(0) == sprite//output: base group should container the nested group: expected: (true) is false console.log 'base group should container the nested group: expected: (true) is', baseGroup.getAt(0) == nestedGroup //output: group#getAt should not expose PIXI Container: expected: (Phaser.Group) is (PIXI.DisplayObjectContainer)console.log 'group#getAt should not expose PIXI Container: expected: (Phaser.Group) is', baseGroup.getAt(0) //Test with countDead which uses group#iterate//First of all: set sprite dead. This is only a flag and should be reflected in method group#countDead.sprite.alive = false//default ist already true, for the sake of consistency.nestedGroup.alive = true//Sprite is DEAD, nestedGroup is ALIVE. Test it://output: our sprite is dead, so this should be 1 is 1 console.log 'our sprite is dead, so this should be 1 is', nestedGroup.countDead()//output: our nested group is alive should be 0 is 1 console.log 'our nested group is alive should be 0 is', baseGroup.countDead()I know that there was an update in a commit between 1.1.3 and 1.1.4 (see this commit). It seems to be related, because of the following selected code line. When nesting a group it's unerlaying PIXI object is added. But the reference to the Phaser.Group is lost at this point isn't it ? So all following calls to group#getAt(index) is return a PIX object and not the Phaser.Group object. add: function (child) { if (child.group !== this) { if (child.type && child.type === Phaser.GROUP) { child.group = this; // Do we lose the reference to the Phaser.Group itself here ? this._container.addChild(child._container); (Source: github) My workaround for now is to maintain a own list/array of group items. It would be great to depend on Phaser's own display list. Thanks for reading. Regards George