I’m in my first hour of learning lua, I’m not particularly impressed with it, tasks like threading/inheritance/delegates are either missing or arcane in usage.
I can’t even seem to position images on the screen, I’m trying to set the origin of an image to its top right corner and then place that image in the top right corner of the screen. Then I would like to scale the image so that the height always matches the screen height. Although I’m not getting the result I desire, I have an idea that I’m misusing unit conversions. An explanation of what I’m doing wrong or links to explanations would be much appreciated.
I have the following code:
local function CreateBackground(path) local bg = display.newImage (path); print(display.actualContentWidth ); local scale = display.actualContentHeight / bg.height; bg:scale(scale, scale); bg.anchorX = 1; bg.anchorY = 0; bg.x = display.actualContentWidth; bg.y = -44; bg:toBack(); return bg; end local bg = CreateBackground("images/background.png");