I have a utility module that contains some basic constants for scene coordinates:
local M = {} local centerX = display.contentCenterX local centerY = display.contentCenterY return M
but when I try to use them in a scene it doesn’t work, the imageRect stays at the original point( top left):
local utils = require("utils") \<\<- name of the file
player.x = utils.centerX player.y = utils.centerY
But it works If I entered the values directly to the (x,y) properties of the imageRect:
player.x = display.contentCenterX player.y = display.contentCenterY
Why doesn’t it work?