## Recommended Posts

Example:

Things I don't understand

1) Why is the SUB bunny as big as first, because I haven't added w, h or scale for it?

2) Why is the SUB bunny positioned like that? Basic math tell's me X=200 (bunny pos.)  + X=10.5 (sub bunny), should be 210.5.

From watching in PIXI source, I see the reason is that parent matrix is added to Child. But, this makes really hard to work with nested sprites.

If I want the subBanny with default size, positioned in 10.5 in bunny, I would have to manually calculate dimension and position parameters,

so when matrix is added, it looks right? Shouldn't PIXI add parent matrix to child, only if The child already added to That parent... or something like that?

##### Share on other sites

When I work for example with SVG or KHA, there is default width and height and position, that has nothing to do with transforms.

Transform is only applied when you start scale, move, etc. And if you choose to do so.

##### Share on other sites

first, thank you because you've fixed that ssl issue i was blocked with phaser

second, seems like assets directly from github are working fine with pixi

then, i am trying to understand (to be edited if i find the problem )

##### Share on other sites

4 minutes ago, douglas said:

first, thank you because you've fixed that ssl issue i was blocked with phaser

second, seems like assets directly from github are working fine with pixi

then, i am trying to understand (to be edited if i find the problem )

What?

##### Share on other sites

I edit my responses and comments after because of google bots, so, when someone is googling a question on phaser he'll find the right answer

so the devs can optimise the search on the forum

##### Share on other sites

28 minutes ago, trsh said:

1) Why is the SUB bunny as big as first, because I haven't added w, h or scale for it?

2) Why is the SUB bunny positioned like that? Basic math tell's me X=200 (bunny pos.)  + X=10.5 (sub bunny), should be 210.5.

When you set the width & height of a sprite, internally you are actually ARE changing it's scale. Thus, you have scaled the first bunny - and since the second bunny is a child of the first bunny, it will also get scaled.

##### Share on other sites

Just now, themoonrat said:

When you set the width & height of a sprite, internally you are actually ARE changing it's scale. Thus, you have scaled the first bunny - and since the second bunny is a child of the first bunny, it will also get scaled.

I already wrote that my self. Can you comment on:

Quote

But, this makes really hard to work with nested sprites.

If I want the subBanny with default size, positioned in 10.5 in bunny, I would have to manually calculate dimension and position parameters,

so when matrix is added, it looks right? Shouldn't PIXI add parent matrix to child, only if The child already added to That parent... or something like that?

??

##### Share on other sites

Quote

1) Why is the SUB bunny as big as first, because I haven't added w, h or scale for it?

My comprehension is at this point

##### Share on other sites

Because "width" changes the scale. I had proposition about "size" variable that behaviour is different. It isnt accepted yet. Right now you have to use extra container that will be parent to both of these bunnies to solve that.

##### Share on other sites

1 hour ago, ivan.popelyshev said:

Because "width" changes the scale. I had proposition about "size" variable that behaviour is different. It isnt accepted yet. Right now you have to use extra container that will be parent to both of these bunnies to solve that.

Noooooooooooooo! :))

So.. The architectural right now is a little bit off! Because some objects could be like 100% static, and they dont need Transformation (updateTransformation etc,) at all, still can have x,y,w,h and been drawn.

Right now pixi calls updateTransform on every frame and object?

##### Share on other sites

@trsh yeah, it calls it every time, but matrix computations are performed only if something was changed. pixi v3 computed all matrices every frame.

##### Share on other sites

13 minutes ago, ivan.popelyshev said:

@trsh yeah, it calls it every time, but matrix computations are performed only if something was changed. pixi v3 computed all matrices every frame.

OK. Thanks for the info.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.