public float getX() {

        float newX = x;
        if(parent!=null){
            newX+=parent.getX();
        }

        if(horizontalAlignment.equals(HorizontalAlignment.center)){
            return newX - ((width/2)) + (parent.getWidth()/2);
        }
        if(horizontalAlignment.equals(HorizontalAlignment.right)){
            return newX + ((parent.getWidth()-width));
        }
        if(horizontalAlignment.equals(HorizontalAlignment.left)){
            return newX;
        }

        return newX;
    }