Solved Reference Error: mapToItem is not defined
-
This is the code:
var pnt = mapToItem(player, food.x, food.y);
I'm getting Reference Error: mapToItem is not defined.
I guess I have to include something, but I'm not sure what and where? -
mapToItem()
is a function ofItem
component - so you need to specify an object. Example:Rectangle { id: foo } function getPoint() { let pnt = foo.mapToItem(player, food.x, food.y) return pnt }
-
mapToItem()
is a function ofItem
component - so you need to specify an object. Example:Rectangle { id: foo } function getPoint() { let pnt = foo.mapToItem(player, food.x, food.y) return pnt }