示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundImage"/> class.
        /// </summary>
        /// <param name="cameraProvider">The camera provider.</param>
        /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        /// <exception cref="ArgumentNullException"><paramref name="cameraProvider" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="map" /> is <c>null</c>.</exception>
        protected BackgroundImage(ICamera2DProvider cameraProvider, IMap map, IValueReader reader)
        {
            if (cameraProvider == null)
                throw new ArgumentNullException("cameraProvider");
            if (map == null)
                throw new ArgumentNullException("map");

            _cameraProvider = cameraProvider;
            _map = map;

            Read(reader);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundImage"/> class.
        /// </summary>
        /// <param name="cameraProvider">The camera provider.</param>
        /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        /// <exception cref="ArgumentNullException"><paramref name="cameraProvider" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="map" /> is <c>null</c>.</exception>
        protected BackgroundImage(ICamera2DProvider cameraProvider, IMap map, IValueReader reader)
        {
            if (cameraProvider == null)
            {
                throw new ArgumentNullException("cameraProvider");
            }
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            _cameraProvider = cameraProvider;
            _map            = map;

            Read(reader);
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundImage"/> class.
        /// </summary>
        /// <param name="cameraProvider">The camera provider.</param>
        /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
        /// <exception cref="ArgumentNullException"><paramref name="cameraProvider" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="map" /> is <c>null</c>.</exception>
        protected BackgroundImage(ICamera2DProvider cameraProvider, IMap map)
        {
            if (cameraProvider == null)
                throw new ArgumentNullException("cameraProvider");
            if (map == null)
                throw new ArgumentNullException("map");

            _cameraProvider = cameraProvider;
            _map = map;

            // Set the default values
            Offset = Vector2.Zero;
            Alignment = Alignment.TopLeft;

            _sprite = new Grh(null, AnimType.Loop, map.GetTime());
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundImage"/> class.
        /// </summary>
        /// <param name="cameraProvider">The camera provider.</param>
        /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
        /// <exception cref="ArgumentNullException"><paramref name="cameraProvider" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="map" /> is <c>null</c>.</exception>
        protected BackgroundImage(ICamera2DProvider cameraProvider, IMap map)
        {
            if (cameraProvider == null)
            {
                throw new ArgumentNullException("cameraProvider");
            }
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            _cameraProvider = cameraProvider;
            _map            = map;

            // Set the default values
            Offset    = Vector2.Zero;
            Alignment = Alignment.TopLeft;

            _sprite = new Grh(null, AnimType.Loop, map.GetTime());
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundLayer"/> class.
 /// </summary>
 /// <param name="cameraProvider">The camera provider.</param>
 /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
 /// <param name="reader">The reader.</param>
 public BackgroundLayer(ICamera2DProvider cameraProvider, IMap map, IValueReader reader)
     : base(cameraProvider, map, reader)
 {
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundLayer"/> class.
 /// </summary>
 /// <param name="cameraProvider">The camera provider.</param>
 /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
 public BackgroundLayer(ICamera2DProvider cameraProvider, IMap map) : base(cameraProvider, map)
 {
     // Set the default values
     HorizontalLayout = BackgroundLayerLayout.Stretched;
     VerticalLayout = BackgroundLayerLayout.Stretched;
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundLayer"/> class.
 /// </summary>
 /// <param name="cameraProvider">The camera provider.</param>
 /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
 /// <param name="reader">The reader.</param>
 public BackgroundLayer(ICamera2DProvider cameraProvider, IMap map, IValueReader reader)
     : base(cameraProvider, map, reader)
 {
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundLayer"/> class.
 /// </summary>
 /// <param name="cameraProvider">The camera provider.</param>
 /// <param name="map">The map that this <see cref="BackgroundImage"/> is on.</param>
 public BackgroundLayer(ICamera2DProvider cameraProvider, IMap map) : base(cameraProvider, map)
 {
     // Set the default values
     HorizontalLayout = BackgroundLayerLayout.Stretched;
     VerticalLayout   = BackgroundLayerLayout.Stretched;
 }