So, I have a JSON file as follows:
{
"type": "sprite",
"name": "town_hall_1",
"visible": "true",
"image": "../js/../public/sprites/buildings/town_halls_1.png",
"size": {"x": 600, "y": 600},
"pixelPerfectMouseEvents": 255
}
and I create the isometric scene object with
console.log(imageJsonFile); // imageJsonFile is the filename of the above JSON file.
const objectData = {
sprites: wade.getJson(imageJsonFile),
gridSize: {x: 2, z: 2},
collisionSize: {x: 2, z: 2},
dontAddToScene: true,
};
const townHall = wade.iso.createObject(objectData, {x: 5, z: -2} );
console.log(townHall.getSpriteOffset(0));
townHall.setSpriteOffset(0, {x: 0, y: -1000} );
console.log(townHall.getSpriteOffset(0));
...
...
...
wade.addSceneObject(townHall);
The console.log statements before and after setting the offset tell me that yes, the offset is indeed changed. But that doesn't show up on screen: the sprite and the collision map still have the same positions relative to each other.