0

im expermenting with c# and XNA and was just wondering that is possible
im trying to do this is there way to change the name of the proptery or field so i can declare to something the built in xna will recognize?

rectangle.Location.Above top;

or

xTile.Dimensions.Location.Origin.Above top;
2
Contributors
8
Replies
9
Views
4 Years
Discussion Span
Last Post by XEN0
0

No, you can't use it like a type, but you can use the Typeof(field) as a type.

Not sure what you are really asking here, could you explain more what you are trying to do?

0

im using xTile.dll and xTilepipeline.dll(dll for tIde map editor so you can import 2d tile maps into game) ok now im using a tutorial on camera and trying to change it so i can import the map heres where i get errors

private void CalculateBoundingRectangle()
        {
            
            if (texture != null)
            {
                
                
                rectangle = new xTile.Dimensions.Rectangle(0, 0, texture.Width, texture.Height);
                Vector2 leftTop = Vector2.Transform(new Vector2(rectangle.Location.Left, rectangle.top), Transform);
                Vector2 rightTop = Vector2.Transform(new Vector2(rectangle.Location.Right, rectangle.top), Transform);
                Vector2 leftBottom = Vector2.Transform(new Vector2(rectangle.Location.Left, rectangle.bottom), Transform);
                Vector2 rightBottom = Vector2.Transform(new Vector2(rectangle.Location.Right, rectangle.bottom), Transform);

                Vector2 min = Vector2.Min(Vector2.Min(leftTop, rightTop),
                                  Vector2.Min(leftBottom, rightBottom));
                Vector2 max = Vector2.Max(Vector2.Max(leftTop, rightTop),
                                          Vector2.Max(leftBottom, rightBottom));

                rectangle = new xTile.Dimensions.Rectangle((int)min.X, (int)min.Y,
                    (int)(max.X - min.X), (int)(max.Y - min.Y));
            }

now im trying to use the rectangle.location.above from the dll but it throws an error
so im trying to change above to top

0

Could you possibly tell me what error, exactly, it is throwing and which line? Can't see your monitor from here.

0

cannot convert from 'xTile.Dimensions.Location' to 'float'
The best overloaded method match for Microsoft.XNA.Framework.Vector2.Vector2(float,float)' has some invalid arguments.

0

on line 9 but line 9 now looks like

Vector2 leftTop = Vector2.Transform(new Vector2(rectangle.Location.Left, rectangle.Location.Above), Transform);
0

It's telling you that xTile.Demensions.Location isn't a float. I have no idea what it actually is (I suspect that it is an x/y coordinate).

0

right you are Sensei it is indeed a x y coordinate im not sure but im guessing the

xTile.Dimensions.Location.Origin.Above

im guessing above is also referring to an x or y coordinate im not sure theres not much documentation to these dlls

0

im also unsure but the Vector2 only takes top for a coordinate so if i could somehow change the above code to make it so Above is top then it might work

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.