How do I get a moving layer

How do I get a moving layer? Especially text layers.
I’ve tried to do this, but I can’t seem to get the effect of moving the layer.

 textLayer.setTextBoundBox(
    RectangleF.to_RectangleF(new Rectangle(
        new com.aspose.psd.Point(0, 0), layer.getSize()
    ))
);

Or so it seems, but it still doesn’t work.

textLayer.updateText(text,alignmentPoint);

I’m curious about updateText(String text, Point leftTopCoordinate) What is the effect of setting leftTopCoordinate here?

I checked the documentation and the examples, but I couldn’t find anything relevant. But when I look at the online example, it seems that I can move the layer.

If I can’t move the layer’s position, how can I create a text layer and specify the font (including font, font size, colour, etc.) at the specified position? I can do that, but I don’t know how to change the font.

TextLayer finalTextLayer = image.addTextLayer(text, newRectangle);
finalTextLayer.updateText(text,textLayer.getFont().getSize(),textLayer.getTextColor());

Thank you very much for your reply and help!

@wofbi you can work with the position of Text Layer in the similar way as you do it for the any other layer.

Please check the following code:

String input = “AllTypesLayerPsd.psd”;
String output = “AllTypesLayerPsd.out.java.psd”;

    PsdLoadOptions opt = new PsdLoadOptions();
    opt.setLoadEffectsResource(true);

    try (PsdImage img = (PsdImage) Image.load(input, opt)) {

        for (com.aspose.psd.fileformats.psd.layers.Layer layer : img.getLayers()) {
            if (layer instanceof TextLayer) {
                TextLayer textLayer = (TextLayer) layer;
                int width = (int) layer.getWidth();
                int height = (int) layer.getHeight();
                layer.setLeft(50);
                layer.setTop(50);
                layer.setRight(layer.getLeft() + width);
                layer.setBottom(layer.getTop() + height);
            }
        }

        img.save(output);
    }

Changing the TextBoundBox is can be helpful if you want change the area of Text (it’s affect word wrapping and etc).

If you need to provide complex text changing it’s better to use PSD IText Interface itext - Aspose.PSD for Java - API Reference it gives abilty to edit multiple styles and paragraph in one text layer.