Horizontal and vertical alignment

| 1 min read

I've solved a couple of bugs and I've added a new feature.

When you have a ElementUI type element and the property alignX or alignY set to center, you can now set a value to two new properties: horizontalAlign and verticalAlign.

It is working like Flex, for example if you want your centered element 100 pixels more to the right, let's say 100 pixels from the center point, these properties will help you doing it. The syntax is:

element.alignX = ElementUI.ALIGN_CENTER;
element.alignY = ElementUI.ALIGN_CENTER;
element.horizontalAlign = 100;
element.verticalAlign = -80;

I kept the way BaseUI is working with the elements, if the browser is too small the elements will always stay inside the window with the margin still working, it is also true with these two new properties.

I've updated the demo.