if it was possible to position elements like an image files like in texts with ".centre" then making fluid layouts would be super easy.
This does that. This makes relative positioning to both the page and other objects simple.
fe.load_module("pos")
local posData = {base_width = 1920, base_height = 1080, layout_width = fe.layout.width, layout_height = fe.layout.height, scale= "scale" }
local scale = Pos(posData)
local myimage = fe.add_image("image1.png", 0,0, scale.width(500), scale.height(400))
local secondimage = fe.add_image("image2.png", 0,0, scale.width(400), scale.height(300))
myimage.x = scale.x(0,"center") // position left side to center of page
myimage.x = scale.x(0,"center",myimage) // center image on page
myimage.x = scale.x(0,"center",myimage, second_image, "center") // center against the center of other element
myimage.x = scale.x(0,"center", myimage, second_image, "left") // center against the left edge of other element
myimage.x = scale.x(-300,"center", myimage, second_image, "right" ) // center against the right edge of other element, then move 300px to the left of that
myimage.x = scale.x(0,"right",myimage,second_image,"left") // align the right edge of the image to the left edge of the second image
The scaling part of this module is quite useful to me, but its the ability to relatively position against other elements and the page that really makes my life easier. For instance, I often place the snap image and then align everything else on the page against that snap. So if i change the x/y position for that snap for some reason, everything else is repositioned as well.