LibGDX Issue with getting actors position

So i’ve been sat here for a while trying to get the position of an image that is inside my UI table, i’m completely stumped.

I’m trying to highlight the selected tower so that Android users know which tower they are placing (Damn you no cursor). I’m currently doing the following code but for some reason the highlight image gets offset slightly. I don’t understand what i’m doing wrong. Without getting the localToStage coordinates the images x and y just return 0.

When I print out the images x and y using localToStage, it prints out the correct value! D:


Image image = (Image) event.getListenerActor();
		
Vector2 coordsOfImage = new Vector2(image.getX(), image.getY());
Vector2 localCoordsOfImage = image.localToStageCoordinates(coordsOfImage);
		
currentTowerSelector.setPosition(localCoordsOfImage.x, localCoordsOfImage.y);
		

Below I’ve attached a picture of the issue

http://s3.postimg.org/kovszy3eb/javaw_2015_06_20_20_05_26_89.png

Okay, I have no idea what’s wrong but I found a solution that is easy and works even with resizing. So the main issue I was having was that when I resized the window, the selector was getting moved around in weird locations, even though it shouldn’t. In the end I did the following code snippet:


Cell cell = table.getCell(image);
currentTowerSelector.setPosition(cell.getActorX(), Main.VIRTUAL_HEIGHT - cell.getActorY() - cell.getActorHeight());

For some reason trying to use unproject, screenToWorld, worldToScreen etc (I tried lots of them just in case) all fail but simply adding the height and taking off the position and height works perfectly AND the resize works as well :point: