There’s no examples that In can see, but here’s how it’s used:
1. The component should implement ITransformHost
2. The component needs a TransformModel bead.
3. The component needs a TransformBead. Royale has two TransformBeads. One is
for svg and the other is for HTML elements. Make sure you use the correct one,
or create your own which does what you need.
4. The transformMatrix getters and setters in the component should proxy the
transform model like this:
public function get transformMatrix():Matrix
{
return _transformModel.matrix;
}
public function set transformMatrix(value:Matrix):void
{
_transformModel.matrix = value;
}
If you have those 4 items done, setting the transformMatrix will correctly
transform your view. so basically instead of
>> this.transform.matrix = m;
You’d use this.transformMatrix = m;
HTH,
Harbs
> On Oct 3, 2022, at 5:46 PM, CapitanoG76 <[email protected]> wrote:
>
> Thanks... I would be very interested in learning how to apply transformation
> beads. Could not find an example
>
> On Mon, 3 Oct 2022 at 13:43, Gabe Harbs <[email protected]
> <mailto:[email protected]>> wrote:
> We also now have transformation beads. I’m not at my computer now to find an
> example of how that works, but you I think there might be an example. Yishay
> should be able to explain as well. I think he did that implementation.
>
>> On 3 Oct 2022, at 2:32, CapitanoG76 <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>
>> Hello,
>>
>> I am porting a Flex application into Royale in order to transpile to
>> Javascript.
>>
>> The application had some graphical elements which extended UIComponent and
>> were added as children to an mx.containers.Canvas.
>> I was using UIComponent.transform.matrix to rotate the elements, however in
>> Royale UIComponent does not have the transform property anymore.
>>
>> Is there any way I can apply rotation/translation to my elements? I'd need
>> to write code similar to
>>
>> var m:Matrix = new Matrix();
>> m.rotate(angle);
>> this.transform.matrix = m;
>>
>> Thanks,
>> Marco