Fancy Product Designer rotate element

96 Views Asked by At

I'm using Fancy Product Designer and I want to add an text element. I was able to put together a code that does this, but now I want to rotate this element by 90 deg. Does anyone know how could I achieve this?

Here is my current code:

jQuery(document).ready(function ($) {
                    // Get the FPD product container
                    var fpdContainer = $('.fpd-container');

                    // Check if the FPD container exists
                    if (fpdContainer.length) {
                        // Wait until FPD is initialized
                        fpdContainer.on('productCreate', function () {
                            // Get the FPD API instance
                            var fpdApi = fpdContainer.data('instance');

                            // Define the text element properties
                            var textElement = {
                                type: 'text',
                                source: 'Your Name',
                                title: '',
                                parameters: {
                                    maxFontSize: 60,
                                    width: 280,
                                    height: 50,
                                    colors: '<?php echo $fpd_text_box_color; ?>',
                                    x: <?php echo $fpd_text_box_left; ?>,
                                    y: <?php echo $fpd_text_box_top; ?>,
                                    widthFontSize: 290
                                }
                            };

                            // Add the text element to the FPD product
                            fpdApi.addElement(textElement.type, textElement.source, textElement.title, textElement.parameters);
                        });
                    }
                });```
0

There are 0 best solutions below