예제 #1
0
        public virtual xTile.Tiles.Tile CollisionTest(Vector2 point)
        {
            point.X = (int)((point.X) / 48f);
            point.Y = (int)(point.Y / 48);

            int map_width  = map.GetLayer("Foreground").LayerWidth;
            int map_height = map.GetLayer("Foreground").LayerHeight;

            if (point.X < map_width && point.Y < map_height && point.X >= 0 && point.Y >= 0)
            {
                xTile.Tiles.Tile tile = map.GetLayer("Foreground").Tiles[(int)point.X, (int)point.Y];
                if (tile != null)
                {
                }
                return(tile);
            }

            return(null);
        }
예제 #2
0
        /// <summary>
        /// Draw specific layers.
        /// </summary>
        public void DrawLayer(Camera camera, params string[] layerNames)
        {
            Viewport.X = (int)camera.Position.X;
            Viewport.Y = (int)camera.Position.Y;

            Display.BeginScene();
            {
                foreach (var layerName in layerNames)
                {
                    XMap.GetLayer(layerName).Draw(Display, Viewport, Location.Origin, true);
                }
            }
            Display.EndScene();
        }