Slick2D concatenating two rectangles.

Hey guys, I’m trying to concatenating two rectangles in Slick2D. I have a horizontal one, for instance: length: 96; height: 32 and a vertical one: length 32; height: 94. What I want to achieve is that they result in one new shape namely a cross. So they need to be connected at a center point. Basically I’m just trying to create this cross by laying one rectangle on top of another one.

Slick2D provides methods for that for example union or subtract. However I’m not really understanding what the union method does since my result shape always looks really weird. Additionally I could not find a good explanation somewhere, probably due to the outdated state of Slick2D.

Does anyone know how the union method works or how I could achieve combining the two rectangles to a cross? To be a little bit more specific it is intended that the horizontal length of the cross is the same like the vertical length.

My Code:

			Shape newShape = null;
			Shape rHorizotanl = new Rectangle(0, 0,96,32);		
			Shape rVertical = new Rectangle(48, 0,32,96);
			newShape = rVertical.union(rHorizotanl)[0];

Thanks.