Horizontally Center a layer?

Ok

I learned a little more these days with you guys on this forum

The next thing I'm doing is to horizontally Center a layer (obviously not the background layer).

Here's what I have so far

activeDocument.activeLayer

I can't find a function like:

activeDocument.activeLayer.center(horizontally);

So I came to a break.

Can someone tell me please in the right direction?

Thank you in advance.

Xtools solved the problem.

Tags: Photoshop

Similar Questions

  • Changing of connection to the horizontal center position

    Hello!

    I created a form in British Colombia and added to a page.

    I m happy with the shape, but I want to be in the center of the page. (horizontally is enough)

    Here is the link to the form:

    Opening of session

    I would be so grateful if someone can help me with this. I think that it s not a big deal, but I do know a few things about coding.

    I tried so many different things, but non of them it aligned in the Center.

    I thank you for your help and your efforts, really appreciate it.

    If you need any other information, please let me know.

    Best regards

    Max.

    When you specify the width of the container of the form, also specify the offset. Bootstrap provides helper classes for this purpose.

    Thus,.

        

    would become:

        

    (p.s.: flexbox makes it so easy vertical centering)

  • How to Center a layer?

    Hello friends... I have created a context menu with a tool that creates code in Javascript. The I parameter on a layer (if I don't, the code will display in another line of the screen). Well, it works, but the problem now is when I see the website on a wide screen... layers and its contents do not move, but the rest of the page, because it's all centered... the result is a mess with layers... I have tried to create a table and attach the layer (in one of its cells) but seems there is no way to do it... What should I do? Help, please! Thank you very much

    Why, right here!

    -Change

    on this subject.


    -change

    on this subject.


    and this-

    on this subject.



    and see if that helps.

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.dreamweavermx-templates.com - template Triage!
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================

    "Sw Martin" wrote in message
    News:emiq0u$ADP$1@forums. Macromedia.com...
    > Hello Murray... I doubt that your short answers well known... except
    > This time... I did not understand... when he responded? Thank you to
    > advance...

  • Horizontal labelfield and choisefield Center

    Hi out there,.

    How can I Center a label and a horizontal field of choise that etiquette is the horizontal center of the choise?

    In my source the align attribute is not as I want to:

    LABEL CHOISEFIELD
    CHOISEFIELD
    CHOISEFIELD

    but I want the attribute align as:

    CHOISEFIELD
    LABEL CHOISEFIELD
    CHOISEFIELD

    what I am doing wrong?

    Here is my source:

    HorizontalFieldManager  hManagerLandSuche = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
    
    LabelField Landl = new LabelField(Main.myData._res.getString(LanguagesResource.KEY_lbl_land), LabelField.FIELD_LEFT|LabelField.FIELD_HCENTER); 
    
    choice = new ObjectChoiceField("", choiceArray, 0,ObjectChoiceField.FIELD_LEFT|ObjectChoiceField.FIELD_HCENTER);
    choice.setChangeListener(listenerSuche);
    Object ob = choice.getChoice(choice.getSelectedIndex());
    searchLand = ob.toString();
    
    hManagerLandSuche.add(Landl);
    hManagerLandSuche.add(choice);
    
    vManager.add(hManagerLandSuche);
    
    tab3Manager.add(vManager);
    tab3Manager.add(new SpacerField(480, 2));
    

    Try

    FIELD_VCENTER for manager rather HCENTER.

    But he can't help - it is sometimes difficult to push the alignment for the good work.

  • Center horizontally for Tablet and ADM page?

    Hello

    I create a website in Muse with Horizontal Center of specification for the document. It works very well.

    But now, when I create the Tablet and phone versions, I can not this feature.

    On the surface of the tablet that is 12 "all widgets are stuck to the left, I only can center blocks

    Should I place the code on every page?

    Thank you very much

    You can apply scrolling content with 0 values, so that it is correct in its location.

    Thank you

    Sanjit

  • Center the Widget Menu horizontally

    Hi all

    I have a vertical Menu for phones and a Horizontal Menu for tablets on my Web page. The menus are horizontally centered on their respective master pages. My problem is when the screen of phone or iPad does not match the page width specified in site properties - the menu is off center. I have elements that are fit to width and they work very well. Unfortunately, the position of the menu bar does not change.

    I tried to apply the following code to the CSS file for #menuu100

    left: 50%;

    -webkit-transform: translateX(-50%);


    It does not change the position. In my view, because the object is configured to use a relative position. If I change to absolute, the menu moves to the horizontal center of the window, but a vertical layout of the Web page is messed up.


    Any suggestions how to solve this problem?


    Sang A

    Hi sang.

    Your father called DIV:

    has a rule called CSS float: left;

    Meaning: Your menu is forced to stay oriented left no matter what style.css , you put:

    See Figure 1 for the wrong position.

    Solution: Change the none; float in your site_global.css @ this specific class: #position_content or .position_content

    See Figure 2 for the right position.

    Hope this helps your problem and good luck.

  • Center the movie element horizontally?

    Hello.

    How I horizontally Center 1 item in my flash movie, so when the film is also at the Center.

    Im guessing Iconvert it to a clip, does he know any script action (actionscript 2 please).

    Thank you

    convert it to a movieclip and set its reg point to its horizontal center.  Add a listener for resizing of scene (check the help files for the code example) and use:

    yourmc._x = internship. Width/2;

    to Center.

  • JS - selection of the center of the artboard / New Document with some dimensions of the artboard

    TL; DR:

    How do I Center my current selection to the artboard?

    as well as hitting the "align horizontal center" and the «align vertical center» buttons

    Hello

    I searched for the last two hours and before my head hit the keyboard I wanted to ask for help.

    What I am struggling with:

    in my init function, I create a new document and then copy all the layers of the previous document step by step to the new document and then save it as SVG.

    Init

    (function() {}

    Destination = Folder.selectDialog ("selecting a folder for files SVG.', docPath");

    If (! destination) {return ;}

    holderDoc = app.documents.add ();

    stepThroughAndExportLayers (docRef.layers);

    }());

    My problem is that holderDoc = app.documents.add (); always creates a document that is not the same size as my original document where the layers are copied from.

    so, I want the same artboard size as in my original document.

    I am fine with the fact that fixed values or directly take the values of the initial RFSO.

    I tried this on the segment where I create the new document:

    Init

    (function() {}

    Destination = Folder.selectDialog ("selecting a folder for files SVG.', docPath");

    If (! destination) {return ;}

    holderDoc = app.documents.add ();

    holderDoc.artboards [0] .artboardRect = [0,0,128,128];

    stepThroughAndExportLayers (docRef.layers);

    }());

    and receive this error message:

    "Error 1200: Illustrator error: 1346458189 ("PARM").

    Online: 83

    -> holderDoc.artboards [0] .artboardRect = [0,0,128,128]; »

    what I read on the web means that illustrator does not know what to choose document. but I called him directly. so, what could be the problem?

    to clearify: I don't want to adapt to the artboard for the images/layer. the work plan must always be a certain size. (for me 128px by 128px)

    Thank you for helping me to each fixing of my approach highly or offer a completely new.

    Thank you very much in advance.

    Edit: workaround solution


    (function() {}

    Destination = Folder.selectDialog ("selecting a folder for files SVG.', docPath");

    If (! destination) {return ;}

    var activeArtboard = app.activeDocument.artboards [app.activeDocument.artboards.getActiveArtboardIndex ()];

    var ABRect = activeArtboard.artboardRect;

    holderDoc = app.documents.add ();

    holderDoc.artboards.add (ABRect);

    holderDoc.artboards.remove (0);

    holderDoc.artboards.setActiveArtboardIndex (0);

    stepThroughAndExportLayers (docRef.layers);

    }());

    now, I added a new work plan to the new document with the same size as the work plan on the original document.

    I have remove the work plan predefined on the new doc and the new work plan as active.

    BUT!

    now, the work plan is not centered in the window. Illustrator that allows to place my image with ctrl + c-> ctrl + v somewhere outside the artboard.

    Now I need to align my selection in the center of the artboard. but I can't find any reference on how to Center a selection to the artboard.

    I don't know if I understand you right.

    If you want to create a new document with a fixed width and height, you can do this:

    var doc = app.documents.add(DocumentColorSpace.RGB, new UnitValue ("128", "px"), new UnitValue ("128", "px"));
    

    If you want to only align your objects selected on the artboard, you can try this:

    Note that the result may be different, if the clipping masks are exist in the document.

    Please test it first on copies of your documents. Use it at your own risk.

    // ArtboardCenterAroundSelectedPaths.jsx
    // works with CS5
    // http://forums.adobe.com/thread/1336506?tstart=0
    // (title: script to align selected objects to artboard)
    // quick & dirty, all selected items will be centered at the active artboard
    // (include clipping paths  !visible result can be different)
    
    // regards pixxxelschubser  19.Nov. 2013
    
    var aDoc = app.activeDocument;
    var Sel = aDoc.selection;
    
    if (Sel.length >0 ) {
        var abIdx = aDoc.artboards.getActiveArtboardIndex();
        var actAbBds = aDoc.artboards[abIdx].artboardRect;
    
        var vBounds = Sel[0].visibleBounds;
        vBounds_Li = vBounds[0];
        vBounds_Ob = vBounds[1];
        vBounds_Re = vBounds[2];
        vBounds_Un = vBounds[3];
    
    if (Sel.length >1 ) {
        for (i=1; i vBdsI[0] ) {vBounds_Li = vBdsI[0]};
            if( vBounds_Ob < vBdsI[1] ) {vBounds_Ob = vBdsI[1]};
            if( vBounds_Re < vBdsI[2] ) {vBounds_Re = vBdsI[2]};
            if( vBounds_Un > vBdsI[3] ) {vBounds_Un = vBdsI[3]};
            }
    
        aDoc.artboards[abIdx].artboardRect = [vBounds_Li +((vBounds_Re - vBounds_Li)/2-(actAbBds[2]-actAbBds[0])/2), vBounds_Ob -((vBounds_Ob - vBounds_Un)/2+(actAbBds[3]-actAbBds[1])/2), vBounds_Li +((vBounds_Re - vBounds_Li)/2-(actAbBds[2]-actAbBds[0])/2)+(actAbBds[2]-actAbBds[0]), vBounds_Ob -((vBounds_Ob - vBounds_Un)/2+(actAbBds[3]-actAbBds[1])/2)+(actAbBds[3]-actAbBds[1])];
        }
        } else {
            alert ("No selection");
            }
    

    Hope this is useful for you.

    Have fun

  • Layer centering

    How to Center a layer of the browser window, horizontally and vertically?

    Vertical centering is not usually recommended. This demo would be OK for a card business or home page only.

    http://ALT-Web.com/templates/vertical-center.html

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB
    http://ALT-Web.blogspot.com

  • Problem with the placement of components in the Center

    I have the screen or full-screen and four ButtonField. How can I put buttons to this container in the Center (vertically and horizontally)?

    I try to use the Field.FIELD_HCENTER flag. ButtonField.HCENTER | Field.FIELD_VCENTER | ButtonField.VCENTER for buttons, but they take only horizontal center

    I struggled with this before as well.  Here's what I found to work for a single centering element:

    VerticalFieldManager vfm = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.NO_HORIZONTAL_SCROLL | VerticalFieldManager.NO_VERTICAL_SCROLL);
    
    // Create a horizontally centered HFM
    HorizontalFieldManager hfm = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_HEIGHT | HorizontalFieldManager.NO_HORIZONTAL_SCROLL | HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.FIELD_HCENTER);
    
    // Create a vertically centered label
    LabelField label = new LabelField("Test", LabelField.FIELD_VCENTER);
    hfm.add(label);
    
    vfm.add(hfm);
    add(vfm);
    

    You should be able to extend this to do what you want to do with an another VerticalFieldManager.

    T

  • Text 'Vertical Align Center' and a form

    Hello developers,

    I wonder if someone could give me a hand with the alignment of text and forms? I want to align a number at the center of a circle. "Horizontal center alignment" works well. "Center vertical alignment", however, does not give the desired result. The number turns out to be higher in the cycle (see figure below). The distance between the top of the circle to the top of the number zero, X, is shorter than the distance between the bottom of the circle and the lower part of the number zero. Is it possible for these two distances equal?

    Capture - Copy.PNG

    Figure 1: Results of Vertical focus

    Thank you

    Haobo

    Vectorize the text and align it. Editable text is aligned based on the em box, which determines the alignment of the character, not only the visible contours...

    Mylenium

  • Why are not part of my Center site?

    I have a whole site built and everything looks great. The problem is that some parts (more specifically the menu I have in the header) are not centering. I have a horizontal centering on, it looks perfect, then when I saw the menu turns off path to the left. What can I do to fix this?

    In fact, I managed to understand. I was accidentally pinned that section left so it was not respecting the horizontal center. If anyone else has this problem I would check for this.

  • Edge: Resizable layout - object Center

    Hello

    I want to put an image to make it a horizontal center with a 100% width set in the background of the scene. At the edge, under the Position and size, I see only options for the positions of left or right.

    When in full-screen preview, I see my image either to the left or right pin, but not Center. Is there anyway that I can center the image?

    Thank you.

    screen.png

    Hi Shagon, symbols of centering is tricky if you try to do it with the built-in tools of edge. Note: the % width option to appear on a symbol, to go into the symbol and set the width of the symbol %. But I found that it works not so well for the centering of the symbol.

    I would recommend to use CSS to Center your symbol, I received this excerpt from Sarah Hunt. Play with the 'width' property to perfectly Center your symbol. Put this code on the scene/compositionReady event.

    focus symbol horizontally

    .CSS ({$("your_symbol") sym.

    Width: "870px."

    "margin: ' auto 0."

    position: 'parent '.

    });

  • In the Label alignment Center

    Hello
    I work in flex 4.

    I use a string named str varaible and I stored
    Str = "would become computer literal to alll his things in six months with a computer."

    I want the str variable is divided into San and William. I used to divide the str variable by using the following lines

    if(Str.Length>50)
    {
    San = str.substring (0, str.lastIndexOf ("", 50));
    slithe = str.substring (str.lastIndexOf ("", 50) + 1);
    firstLine();
    Alert.Show (William);
    }
    on the other
    {
    San = str;
    slithe ="";
    firstLine();

    }

    So I want to create labels of words each using these lines


    private void firstLine (): void
    {
    Alert.Show (San);
    var l1:Number = fline.length;
    Alert.Show (L1. ToString());

    myArr = Fline.Split ("");
    myarr1 = slithe. Split("");

    var l1:Number = Number (l);
    = myarr.length inputValue;
    Alert.Show (inputValue.ToString ());
    for (var intLoop:int = 0; intLoop < inputValue; intLoop ++)
    {
    LBL = new Sun;
    LBL.ID = "l" + intLoop;
    LBL. Text = myarr [intLoop];
    LBL1 = new Sun;
    LBL1.ID = "l" + intLoop;
    LBL1. Text = myarr1 [intLoop];

    lbl.addEventListener (MouseEvent.MOUSE_OVER, onLabelOver);
    lbl.addEventListener (MouseEvent.CLICK, onLabelClick);
    lbl.addEventListener (MouseEvent.MOUSE_OUT, onLabelOut);
    lbl.styleName = "hai1";

    LBL1.addEventListener (MouseEvent.MOUSE_OVER, onLabelOver);
    LBL1.addEventListener (MouseEvent.CLICK, onLabelClick);
    LBL1.addEventListener (MouseEvent.MOUSE_OUT, onLabelOut);
    LBL1.styleName = "hai1";

    labelBox.addChild (lbl);
    labelBox1.addChild (lbl1);

    }
    labelBox.styleName = "lblalign";

    }

    After I shared the words Add the words (lbl) in labelBox and labelBox1.
    Here the LabelBox and LabelBox1

    < mx:HBox id = "labelBox" x = "54" y = "263" width = "389" height = "18" color = "#FFFFFF" alpha = "0.40" backgroundColor = "#000101" >
    < / mx:HBox >
    < mx:HBox id = "labelBox1" width = "389" height = "20" color = "#FFFFFF" alpha = "0.40" backgroundColor = "#000000" x = "54" y = "280" >

    < / mx:HBox >


    This is displayed as follows
    Would become computer literal to alll
    its things in six months with a computer

    but my requirement is to align this line towards the Center.

    Would become computer literal to alll
    its things in six months with a computer

    Is this possible.
    If possible ways give me some ideas.

    concerning
    Athi

    Hi Athiroy,

    Specify the properties... horizontalAlign = "center" on HBox, if you want to align the label horizontally Center.

    If you want to vertically align Center... then specify verticalAlign = "middle" for HBox

    horizontalAlign = "center" verticalAlign = "middle" color = "#FFFFFF" alpha = "0.40" backgroundColor = "#000101" >

    Thank you

    Jean Claude

  • Central to a layer anchor point

    How can I Center the anchor Point to center of layer? Are there commands to align a central point?

    The update after effects CC (12.1) adds the ability to move the anchor point to the center of the visible content of any layer.

    See this page for more details:

    http://Adobe.LY/AE_CC_12dot1_details

Maybe you are looking for