Postby erwan10 » 02 Jan 2014 13:20
position, xmargin, ymargin, xoffset and yoffset parameters are available only for a limited set of tags. The <Image> tags doesn't support them. For tags not directly supporting them, an additional <Panel> tag can be used as an enclosure.
Also, don't mix up things. Either you use (position, xmargin, ymargin) parameters or you use (x, y) parameters. The former set is a helper to avoid strenuous (x,y) calculations or to adapt to the actual screen resolution at run-time. If position is provided, then (x,y) are dynamically computed. Additional x or y are just ignored.
Also, as of the current release, everything can now be expressed with the six (x,y, width, height, xoffset, yoffset) parameters. The (position, xmargin, ymargin, xoffset, yoffset) parameters are just additional helpers that now are a bit redundant. In particular, all (x,y, width, height) parameters accept values relative to their upper container. x and y can also be expressed absolutely or with percentage. xoffset and yoffset accept absolute values or percentage values relative to the current tag. They can be positive or negative values.
To help clarify things, here is an example:
<Panel width="80%" x="50%" xoffset="-50%" ...> describes a panel with a width worth 80% of the upper container (a layout or another panel), with the origin placed in the middle of the upper container and then translated to the left worth 50% of this panel size.
This is slightly different from <Panel width="80%" position= "Center" .... > because position is a two-dimensional parameter that always works with both x and y.
The above syntax with x and xoffset is a bit more difficult to apprehend, but it is a lot more powerful, because you can work on x and on y independently.