Return to Starling Playback Library

pivot points, how are they used?

Questions related to Starling playback library should be asked here.

pivot points, how are they used?

Postby Gigi Marzullo » May 27th, 2017, 7:26 am

I noticed the starling library is reading a pivot point displacement inside BinGAFAssetConfigConverter.as
Code: Select all
pivot = new Point(this._bytes.readFloat(), this._bytes.readFloat());


For what is this used, I have to zero in all pivots it because it's causing issues in my app.
How do you influence this values from within Adobe Animate?
User avatar
Gigi Marzullo
 
Posts: 19
Joined: March 10th, 2017, 4:42 pm

Re: pivot points, how are they used?

Postby Gigi Marzullo » July 14th, 2017, 7:34 am

I always bang into this problem, with some sort of random PivotMatrix set, I wonder what determines this and how can center stuff in the IDE in order to have this PivotMatrix centered at 0,0.
I noticed that I get this tx, ty pivot values when I set a filter in the IDE, any clue?
User avatar
Gigi Marzullo
 
Posts: 19
Joined: March 10th, 2017, 4:42 pm

Re: pivot points, how are they used?

Postby Sergey Ionov » July 18th, 2017, 6:29 am

If there is a movieclip without any effects (filters) it will be converted with standard rules and will have a standard pivotPoint in the [0,1] range.

Let’s take a different movieclip with the following parameters as an example.
Height=100, width=120, pivotPoint=[0.5,0.5] and imagine it has the blur filter applied to it with blurX=20, blurY=20.
To process this movieclip the initial pivotPoint values will be transformed into relative values of object bounds, in other words pivot=[0.5,0.5] will become pivot=[50,60]. And then offsets of both axes will be added to these values like this 50+~20 and 60+~20.
So in the end we’re getting pivotPoint=[~70,~80] which may seem odd if you're not aware of the internal settings of our Converter which I just described.

All of this is necessary because when conversion happens some of the objects may have transparent backgrounds and in order for them to be cropped properly on the Converter side the pivotPoint is recalculated to mantain a precise copy of the initial object. And that’s basically the logic behind all GAF transformations for object reconstruction.

I hope that helps.
Thank you.
User avatar
Sergey Ionov
 
Posts: 14
Joined: May 23rd, 2016, 4:14 am

Return to Starling Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest