In java there is a varible type called Dimension where you can store a width and a height ex: Dimension dimension = new Dimension(900,600). I need something like this in xna, I’m aware of Vector2 and Point but those are for storing coordinates not a dimension. Can someone tell me something similar in xna?
In java there is a varible type called Dimension where you can store a
Share
While tom502’s answer is technically correct, it requires you to reference
System.Drawing.dll, which is only available on the Windows platform.If you want to stick to straight XNA, you should either just use
Vector2or implement your ownDimensionstructure. You’re correct in that aVector2is supposed to represent a spatial coordinate, rather than the size of an object, but XNA itself uses it to represent size as well–for example, when measuring strings. There’s not a whole lot of point in having two structures that are basically identical except for name.