Ejemplo n.º 1
0
        /// <summary>
        /// Draw the layer.
        /// </summary>
        /// <param name="renderTime">Time since last render.</param>
        /// <remarks>include base.Render(renderTime); in overloads to preserve updating RenderTime field.</remarks>
        public override void Render(RenderTime renderTime)
        {
            base.Render(renderTime);
            if (MM_Repository.OverallDisplay.MapTiles == MM_MapTile.enumMapType.None)
            {
                return;
            }

            var tx = Surface.RenderTarget2D.Transform;

            Surface.RenderTarget2D.Transform = SharpDX.Matrix3x2.Identity;
            BaseMapTileProxy backgroundTile;
            Point            topLeftTile      = MM_Coordinates.XYToTile(Surface.Coordinates.TopLeftXY);
            Point            bottomRightTile  = MM_Coordinates.XYToTile(Surface.Coordinates.BottomRightXY);
            Point            topLeftTileShift = new Point(Surface.Coordinates.TopLeftXY.X % MM_Repository.OverallDisplay.MapTileSize.Width, Surface.Coordinates.TopLeftXY.Y % MM_Repository.OverallDisplay.MapTileSize.Height);
            int extraRadius = 4;

            SharpDX.RectangleF tileSourceRect = new SharpDX.RectangleF(0, 0, MM_Repository.OverallDisplay.MapTileSize.Width, MM_Repository.OverallDisplay.MapTileSize.Height);

            if (MM_Repository.OverallDisplay.MapTiles != MM_MapTile.enumMapType.None)
            {
                int startX = topLeftTile.X - extraRadius;
                int endX   = bottomRightTile.X + extraRadius;
                int startY = topLeftTile.Y - extraRadius;
                int endY   = bottomRightTile.Y + extraRadius;


                foreach (var thisTile in Spiral(topLeftTile, bottomRightTile, extraRadius))
                {
                    TileCoordinates tileCoord = new TileCoordinates(MM_Repository.OverallDisplay.MapTiles, thisTile, (int)Surface.Coordinates.ZoomLevel);
                    if (TryGetTile(tileCoord, out backgroundTile))
                    {
                        if (!backgroundTile.IsReady)
                        {
                            continue;
                        }

                        var targetRect = new SharpDX.RectangleF(((thisTile.X - topLeftTile.X) * MM_Repository.OverallDisplay.MapTileSize.Width) - topLeftTileShift.X, ((thisTile.Y - topLeftTile.Y) * MM_Repository.OverallDisplay.MapTileSize.Height) - topLeftTileShift.Y, MM_Repository.OverallDisplay.MapTileSize.Width, MM_Repository.OverallDisplay.MapTileSize.Height);
                        Surface.RenderTarget2D.DrawBitmap(backgroundTile.Bitmap, targetRect, MM_Repository.OverallDisplay.MapTransparency, BitmapInterpolationMode.NearestNeighbor, tileSourceRect);
                    }
                }

                //for (Point thisTile = new Point(topLeftTile.X - extraRadius, topLeftTile.Y - extraRadius); thisTile.X <= bottomRightTile.X + extraRadius; thisTile.X++, thisTile.Y = topLeftTile.Y)
                //{
                //    for (; thisTile.Y <= bottomRightTile.Y + extraRadius; thisTile.Y++)
                //    {
                //        TileCoordinates tileCoord = new TileCoordinates(MM_Repository.OverallDisplay.MapTiles, thisTile, (int)Surface.Coordinates.ZoomLevel);
                //        if (TryGetTile(tileCoord, out backgroundTile))
                //        {
                //            if (!backgroundTile.IsReady) continue;
                //
                //            var targetRect = new SharpDX.RectangleF(((thisTile.X - topLeftTile.X) * MM_Repository.OverallDisplay.MapTileSize.Width) - topLeftTileShift.X, ((thisTile.Y - topLeftTile.Y) * MM_Repository.OverallDisplay.MapTileSize.Height) - topLeftTileShift.Y, MM_Repository.OverallDisplay.MapTileSize.Width, MM_Repository.OverallDisplay.MapTileSize.Height);
                //            Surface.RenderTarget2D.DrawBitmap(backgroundTile.Bitmap, targetRect, MM_Repository.OverallDisplay.MapTransparency, BitmapInterpolationMode.NearestNeighbor, tileSourceRect);
                //        }
                //    }
                //}
            }

            Surface.RenderTarget2D.Transform = tx;
        }
Ejemplo n.º 2
0
        public virtual void Process(RenderTime elapsedTime)
        {
            ActionTime += elapsedTime;
            FrameTime  += elapsedTime;
            if (Distance >= TotalDistance)
            {
                TimeSinceArrival += elapsedTime;
            }
            if (FrameTime >= FrameLength)
            {
                FrameTime = FrameTime - FrameLength;
                Frame++;
            }

            if (Frame >= TextureManager.GetSpellSheet(TextureManager.SpellAnimType.Beam, AnimationIndex).TotalFrames)
            {
                Frame = 0;
                if (Distance < TotalDistance)
                {
                    Distance++;
                }
            }

            if (TimeSinceArrival >= LastingTime)
            {
                ActionDone = true;
            }
        }
 public NormalMoveAnimation(Loc2D tileLoc, int animIndex, RenderTime animTime, int loops)
 {
     AnimationIndex = animIndex;
     FrameLength    = animTime;
     TotalLoops     = loops;
     StartLoc       = new Loc2D(tileLoc.X, tileLoc.Y);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Draw the layer.
        /// </summary>
        /// <param name="renderTime">Time since last render.</param>
        /// <remarks>include base.Render(renderTime); in overloads to preserve updating RenderTime field.</remarks>
        public override void Render(RenderTime renderTime)
        {
            base.Render(renderTime);


            var tx = Surface.RenderTarget2D.Transform;

            Surface.RenderTarget2D.Transform = Matrix3x2.Translation(-Surface.Coordinates.TopLeftXY.X, -Surface.Coordinates.TopLeftXY.Y);

            var coordinateBounds = Surface.Coordinates.GetBounds();


            if (MM_Repository.OverallDisplay.DisplayCounties)
            {
                foreach (var dxRegion in regions)
                {
                    var region = dxRegion.Value;

                    if (coordinateBounds.Overlaps(region.Bounds))
                    {
                        Surface.RenderTarget2D.DrawGeometry(region.Geometry, brushes.GetBrush(region.Color), region.Width);
                    }
                }
            }

            if (MM_Repository.OverallDisplay.DisplayStateBorder && state != null)
            {
                if (coordinateBounds.Overlaps(state.Bounds))
                {
                    Surface.RenderTarget2D.DrawGeometry(state.Geometry, brushes.GetBrush(state.Color), state.Width);
                }
            }

            Surface.RenderTarget2D.Transform = tx;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Draw the layer.
        /// </summary>
        /// <param name="renderTime">Time since last render.</param>
        /// <remarks>include base.Render(renderTime); in overloads to preserve updating RenderTime field.</remarks>
        public override void Render(RenderTime renderTime)
        {
            base.Render(renderTime);

            int vertical = 0;

            if (_alignment == ContentAlignment.MiddleLeft || _alignment == ContentAlignment.MiddleCenter || _alignment == ContentAlignment.MiddleRight)
            {
                vertical = 1;
            }
            else if (_alignment == ContentAlignment.BottomLeft || _alignment == ContentAlignment.BottomCenter || _alignment == ContentAlignment.BottomRight)
            {
                vertical = 2;
            }

            int horizontal = 0;

            if (_alignment == ContentAlignment.TopCenter || _alignment == ContentAlignment.MiddleCenter || _alignment == ContentAlignment.BottomCenter)
            {
                horizontal = 1;
            }
            else if (_alignment == ContentAlignment.TopRight || _alignment == ContentAlignment.MiddleRight || _alignment == ContentAlignment.BottomRight)
            {
                horizontal = 2;
            }

            var currentPosition = _startPosition;


            foreach (var message in _messages.ToList())
            {
                if (message.IsDisposed || message.Layout == null || message.Layout.IsDisposed)
                {
                    continue;
                }

                var size  = message.LayoutSize;
                var brush = Surface.Brushes.GetBrush(message.Color, message.Opacity);

                // shift upward before if bottom aligned
                if (vertical == 2)
                {
                    currentPosition.Y -= size.Y;
                }

                // set our horizontal origin
                if (horizontal == 2)
                {
                    currentPosition.X = _startPosition.X - size.X;
                }

                Surface.RenderTarget2D.DrawTextAtPoint(message.Layout, brush, currentPosition.X, currentPosition.Y, centerX: horizontal == 1, centerY: vertical == 1);

                // shift downward after if top aligned
                if (vertical == 0)
                {
                    currentPosition.Y += size.Y;
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Draw the layer.
        /// </summary>
        /// <param name="renderTime">Time since last render.</param>
        /// <remarks>include base.Render(renderTime); in overloads to preserve updating RenderTime field.</remarks>
        public override void Render(RenderTime renderTime)
        {
            // if we don't have a data provider, don't render
            if (DataProvider == null || _kdProxy == null || MM_Repository.OverallDisplay.Contour == MM_Display.MM_Contour_Enum.None)
            {
                return;
            }

            base.Render(renderTime);
            var  displayView = Surface.Coordinates.GetViewXY();
            var  displayRect = Surface.DisplayRectangle;
            var  size        = Surface.RenderTarget2D.PixelSize;
            bool resized     = _displayRect != displayRect;

            bool viewSizeMatchesDisplaySize = displayView.Width == displayRect.Width && displayView.Height == displayRect.Height;

            if ((displayView != _displayView || _bmp == null || _bmp.IsDisposed || resized) && !((MM_Network_Map_DX)Surface).HandlingMouse && viewSizeMatchesDisplaySize && !isRendering)
            {
                _displayRect = displayRect;
                _displayView = displayView;

                _size = size;

                DrawBitmap(Surface.RenderTarget2D.PixelSize.Height / 10,
                           Surface.RenderTarget2D.PixelSize.Width / 10,
                           (float)MM_Coordinates.GConstants[_zoomLevel][1] * _zoomLevel * _zoomLevel, _displayView);
            }

            if (_bmp != null && Surface.RenderTarget2D != null && !((MM_Network_Map_DX)Surface).HandlingMouse)
            {
                var stateLayer = Surface.GetLayers <StateRegionsLayer>().FirstOrDefault();

                var tx = Surface.RenderTarget2D.Transform;
                Surface.RenderTarget2D.Transform = Matrix3x2.Translation(-Surface.Coordinates.TopLeftXY.X, -Surface.Coordinates.TopLeftXY.Y);
                var dest = new SharpDX.RectangleF(-Surface.RenderTarget2D.Transform.M31, -Surface.RenderTarget2D.Transform.M32, Surface.RenderTarget2D.Size.Width, Surface.RenderTarget2D.Size.Height);

                if (MM_Repository.OverallDisplay.ClipContours && stateLayer != null && stateLayer.State != null && stateLayer.State.Geometry != null && !(DataProvider is LineLoadingPercentageContourData))
                {
                    var layerParameters = new LayerParameters()
                    {
                        ContentBounds = RectangleF.Infinite,
                        GeometricMask = stateLayer.State.Geometry,
                        Opacity       = 1,
                        MaskTransform = tx
                    };
                    using (var layer = new Layer(Surface.RenderTarget2D, Surface.RenderTarget2D.Size))
                    {
                        Surface.RenderTarget2D.PushLayer(ref layerParameters, layer);
                        Surface.RenderTarget2D.DrawBitmap(_bmp, dest, 0.5f, BitmapInterpolationMode.Linear);
                        Surface.RenderTarget2D.PopLayer();
                    }
                }
                else
                {
                    Surface.RenderTarget2D.DrawBitmap(_bmp, dest, 0.5f, BitmapInterpolationMode.Linear);
                }

                Surface.RenderTarget2D.Transform = tx;
            }
        }
Ejemplo n.º 7
0
 public override void Process(Input input, ActiveChar character, ref bool moveMade)
 {
     if (input[Input.InputType.Enter] && !Processor.InputState[(int)Processor.InputType.Enter])
     {
         Choose(character, ref moveMade);
     }
     else if (input[Input.InputType.X] && !Processor.InputState[(int)Processor.InputType.X])
     {
         Choose(character, ref moveMade);
     }
     else if (input[Input.InputType.Z] && !Processor.InputState[(int)Processor.InputType.Z])
     {
         MenuManager.Menus.RemoveAt(0);
     }
     else
     {
         bool chooseDown = (input.Direction == Direction8.Down || input.Direction == Direction8.DownLeft || input.Direction == Direction8.DownRight);
         bool prevDown   = (Processor.oldDirection == Direction8.Down || Processor.oldDirection == Direction8.DownLeft || Processor.oldDirection == Direction8.DownRight);
         bool chooseUp   = (input.Direction == Direction8.Up || input.Direction == Direction8.UpLeft || input.Direction == Direction8.UpRight);
         bool prevUp     = (Processor.oldDirection == Direction8.Up || Processor.oldDirection == Direction8.UpLeft || Processor.oldDirection == Direction8.UpRight);
         if (chooseDown && (!prevDown || Processor.InputTime >= RenderTime.FromMillisecs(40)))
         {
             currentChoice = (currentChoice + 1) % Choices.Count;
         }
         else if (chooseUp && (!prevUp || Processor.InputTime >= RenderTime.FromMillisecs(40)))
         {
             currentChoice = (currentChoice + Choices.Count - 1) % Choices.Count;
         }
     }
 }
Ejemplo n.º 8
0
 public OverlayMoveAnimation(int animIndex, RenderTime animTime, int loops, byte transparency)
 {
     AnimationIndex = animIndex;
     FrameLength    = animTime;
     TotalLoops     = loops;
     Alpha          = (byte)(255 - transparency);
 }
Ejemplo n.º 9
0
        public virtual void Process(RenderTime elapsedTime)
        {
            ActionTime += elapsedTime;
            FrameTime  += elapsedTime;
            if (FrameTime >= FrameLength)
            {
                FrameTime = FrameTime - FrameLength;
                Frame++;
            }

            if (Frame >= TextureManager.GetSpellSheet(TextureManager.SpellAnimType.Arrow, AnimationIndex).TotalFrames)
            {
                Frame = 0;
            }

            Distance = ActionTime.ToMillisecs() * TravelSpeed / 1000;

            if (Distance >= TotalDistance)
            {
                ActionDone = true;
            }
            else
            {
                Loc2D mapLoc = new Loc2D(StartLoc.X * TextureManager.TILE_SIZE, StartLoc.Y * TextureManager.TILE_SIZE);
                Operations.MoveInDirection8(ref mapLoc, Direction, Distance);
                MapLoc = mapLoc;
            }
        }
Ejemplo n.º 10
0
        public static void Process(RenderTime elapsedTime)
        {
            if (DebugSpeed == GameSpeed.Pause)
            {
                return;
            }
            else if (DebugSpeed == GameSpeed.Instant)
            {
                ForceReady();
                ProcessActions(elapsedTime);
            }
            else
            {
                int speedFactor = 1000;

                speedFactor = (int)(speedFactor * Math.Pow(2, (int)DebugSpeed));

                RenderTime newElapsed = elapsedTime * speedFactor / 1000;
                ProcessActions(newElapsed);
            }

            //if actions are ready for queue, get a new result
            ProcessTaskQueue(true);

            //update actions at 0 time
            ProcessActions(new RenderTime());
        }
 public CharacterOriginAnimation(int charIndex, int animIndex, RenderTime animTime, int loops)
 {
     AnimationIndex = animIndex;
     FrameLength    = animTime;
     TotalLoops     = loops;
     CharIndex      = charIndex;
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Perform calculations and update data.
        /// </summary>
        /// <param name="updateTime">Time since last update.</param>
        /// <remarks>include base.Update(renderTime); in overloads to preserve updating UpdateTime field.</remarks>
        public override void Update(RenderTime updateTime)
        {
            base.Update(updateTime);
            var textFormat = Surface.Fonts.GetTextFormat(MM_Repository.OverallDisplay.NetworkMapFont, 2);

            foreach (var message in _messages.ToList())
            {
                if (message.IsDisposed)
                {
                    _messages.Remove(message);
                    continue;
                }

                if ((message.SecondsRemaining -= (float)updateTime.ElapsedTime.TotalSeconds) < 0)
                {
                    message.Dispose();
                    _messages.Remove(message);
                }
                else
                {
                    // set opacity, fade out the last second
                    message.Opacity = MathUtil.Clamp(((int)(message.SecondsRemaining * 20)) / 20f, 0, 1);

                    // rebuild text layouts
                    if (message.Layout == null || message.Layout.IsDisposed)
                    {
                        message.Layout     = new TextLayout(Surface.FactoryDirectWrite, message.Message, textFormat, 350, 50);
                        message.LayoutSize = new Vector2(message.Layout.Metrics.Width, message.Layout.Metrics.Height);
                    }
                }
            }
        }
Ejemplo n.º 13
0
        private void nudFrameLength_TextChanged(object sender, EventArgs e)
        {
            int millisecs = 0;

            SetIntFromNumeric(ref millisecs, nudFrameLength);
            chosenAnim.FrameLength = RenderTime.FromMillisecs(millisecs);
            ChangeAnimationTimer();
        }
Ejemplo n.º 14
0
 public static void ForceReady()
 {
     while (!outContainer.IsFinished() || resultContainers.Count > 0)
     {
         ProcessActions(RenderTime.FromMillisecs(1000));
         ProcessTaskQueue(false);
     }
 }
Ejemplo n.º 15
0
 /// Perform calculations and update data.
 /// </summary>
 /// <param name="updateTime">Time since last update.</param>
 /// <remarks>include base.Update(renderTime); in overloads to preserve updating UpdateTime field.</remarks>
 public virtual void Update(RenderTime updateTime)
 {
     UpdateTime = updateTime;
     if (!_isLoaded || _isUnloading)
     {
         return;
     }
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Draw the layer.
 /// </summary>
 /// <param name="renderTime">Time since last render.</param>
 /// <remarks>include base.Render(renderTime); in overloads to preserve updating RenderTime field.</remarks>
 public virtual void Render(RenderTime renderTime)
 {
     RenderTime = renderTime;
     if (!_isLoaded || _isUnloading)
     {
         return;
     }
 }
Ejemplo n.º 17
0
 public TileAnim(Loc2D texture, int sheet)
 {
     Frames = new List <TileTexture>
     {
         new TileTexture(texture, sheet)
     };
     FrameLength = RenderTime.FromMillisecs(1);
 }
Ejemplo n.º 18
0
        /// <summary>
        /// Perform calculations and update data.
        /// </summary>
        /// <param name="updateTime">Time since last update.</param>
        /// <remarks>include base.Update(renderTime); in overloads to preserve updating UpdateTime field.</remarks>
        public override void Update(RenderTime updateTime)
        {
            base.Update(updateTime);

            if (!MM_Repository.OverallDisplay.ShowWeather)
            {
                return;
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Draw the layer.
        /// </summary>
        /// <param name="renderTime">Time since last render.</param>
        /// <remarks>include base.Render(renderTime); in overloads to preserve updating RenderTime field.</remarks>
        public override void Render(RenderTime renderTime)
        {
            base.Render(renderTime);

            if (!MM_Repository.OverallDisplay.ShowWeather)
            {
                return;
            }
        }
Ejemplo n.º 20
0
 public BeamMoveAnimation(Loc2D startLoc, int animIndex, RenderTime animTime, Maps.Direction8 dir, int distance, RenderTime lastingTime)
 {
     StartLoc       = startLoc;
     AnimationIndex = animIndex;
     FrameLength    = animTime;
     Direction      = dir;
     TotalDistance  = distance;
     LastingTime    = lastingTime;
 }
Ejemplo n.º 21
0
 public TileAnim(TileAnim oldTileAnim)
 {
     Frames = new List <TileTexture>();
     for (int i = 0; i < oldTileAnim.Frames.Count; i++)
     {
         Frames.Add(oldTileAnim.Frames[i]);
     }
     FrameLength = oldTileAnim.FrameLength;
 }
Ejemplo n.º 22
0
 public ArrowMoveAnimation(Loc2D startLoc, int animIndex, RenderTime animTime, Maps.Direction8 dir, int distance, int speed)
 {
     StartLoc       = startLoc;
     AnimationIndex = animIndex;
     FrameLength    = animTime;
     Direction      = dir;
     TotalWaves     = distance;
     TotalDistance  = distance * TextureManager.TILE_SIZE;
     TravelSpeed    = speed;
 }
 public void ProcessDelay(RenderTime time)
 {
     foreach (KeyValuePair <int, ResultBranch> entry in branches)
     {
         entry.Value.Delay -= time;
         if (entry.Value.Delay < RenderTime.Zero)
         {
             entry.Value.Delay = RenderTime.Zero;
         }
     }
 }
Ejemplo n.º 24
0
 public void ProcessDelay(RenderTime time)
 {
     for (int i = 0; i < BranchCount; i++)
     {
         branches[i].Delay -= time;
         if (branches[i].Delay < RenderTime.Zero)
         {
             branches[i].Delay = RenderTime.Zero;
         }
     }
 }
Ejemplo n.º 25
0
 public FountainEmitter(Loc2D startLoc, int animIndex, int grainsPerBurst, RenderTime burstTime, int bursts, RenderTime animTime, int startDistance, int speed, RenderTime totalTime)
 {
     StartLoc       = startLoc;
     AnimationIndex = animIndex;
     FrameLength    = animTime;
     TotalTime      = totalTime;
     GrainsPerBurst = grainsPerBurst;
     BurstTime      = burstTime;
     TotalBursts    = bursts;
     StartDistance  = startDistance;
     Speed          = speed;
 }
Ejemplo n.º 26
0
        public ThrowMoveAnimation(Loc2D startLoc, Loc2D endLoc, int animIndex, RenderTime animTime, int speed, bool dropDown)
        {
            StartLoc       = startLoc;
            EndLoc         = endLoc;
            AnimationIndex = animIndex;
            FrameLength    = animTime;
            Loc2D diffLoc = startLoc - endLoc;

            TotalDistance = (int)(TextureManager.TILE_SIZE * Math.Sqrt(Math.Pow(diffLoc.X, 2) + Math.Pow(diffLoc.Y, 2)));
            TravelSpeed   = speed;
            DropDown      = dropDown;
        }
Ejemplo n.º 27
0
        public void Process(RenderTime elapsedTime)
        {
            ActionTime += elapsedTime;

            RenderTime totalTime = ITEM_ACTION_TIME[(int)Action];

            if (ActionTime >= totalTime && Action != ItemAnimType.None)
            {
                ActionDone = true;
            }
            else
            {
                switch (Action)
                {
                case ItemAnimType.None:
                {
                    MapHeight = 0;
                    MapLoc    = StartLoc;
                    break;
                }

                case ItemAnimType.Drop:
                {
                    MapHeight  = DrawHelper.GetArc(TextureManager.TILE_SIZE / 4, totalTime.Ticks, ActionTime.Ticks);
                    MapHeight += TextureManager.TILE_SIZE * (totalTime - ActionTime).Ticks / 2 / totalTime.Ticks;
                    Loc2D mapDiff = (EndLoc - StartLoc) * TextureManager.TILE_SIZE;
                    mapDiff = new Loc2D(mapDiff.X * ActionTime.Ticks / totalTime.Ticks, mapDiff.Y * ActionTime.Ticks / totalTime.Ticks);
                    MapLoc  = mapDiff + StartLoc * TextureManager.TILE_SIZE;
                }
                break;

                case ItemAnimType.Bounce:
                {
                    MapHeight = DrawHelper.GetArc(TextureManager.TILE_SIZE / 2, totalTime.Ticks, ActionTime.Ticks);
                    Loc2D mapDiff = (EndLoc - StartLoc) * TextureManager.TILE_SIZE;
                    mapDiff = new Loc2D(mapDiff.X * ActionTime.Ticks / totalTime.Ticks, mapDiff.Y * ActionTime.Ticks / totalTime.Ticks);
                    MapLoc  = mapDiff + StartLoc * TextureManager.TILE_SIZE;
                }
                break;

                case ItemAnimType.Deflect:
                {
                    MapHeight  = DrawHelper.GetArc(TextureManager.TILE_SIZE / 2, totalTime.Ticks, ActionTime.Ticks);
                    MapHeight += TextureManager.TILE_SIZE * (totalTime.Ticks - ActionTime.Ticks) / 2 / totalTime.Ticks;
                    Loc2D mapDiff = (EndLoc - StartLoc) * TextureManager.TILE_SIZE;
                    mapDiff = new Loc2D(mapDiff.X * ActionTime.Ticks / totalTime.Ticks, mapDiff.Y * ActionTime.Ticks / totalTime.Ticks);
                    MapLoc  = mapDiff + StartLoc * TextureManager.TILE_SIZE;
                }
                break;
                }
            }
        }
Ejemplo n.º 28
0
        public TileMoveAnimation(Loc2D startLoc, int animIndex, RenderTime animTime, int loops, Enums.RangeType rangeType, Maps.Direction8 dir, int range, RenderTime stallTime)
        {
            AnimationIndex = animIndex;
            FrameLength    = animTime;
            TotalLoops     = loops;
            StartLoc       = startLoc;
            RangeType      = rangeType;
            Direction      = dir;
            TotalDistance  = range;
            StallTime      = stallTime;

            FrameTime = StallTime;
        }
Ejemplo n.º 29
0
        //float scale;
        //float scaleSpeed;
        //float rotation;
        //float rotationSpeed;

        public ParticleAnimation(int animationIndex, RenderTime frameLength, Loc2D newPosition, Loc2D newSpeed, Loc2D newAcceleration, Color4 newAlpha, Color4 newAlphaSpeed, RenderTime newMaxTime)
        {
            AnimationIndex = animationIndex;
            FrameLength    = frameLength;
            MapLoc         = newPosition;
            StartLoc       = MapLoc;
            Speed          = newSpeed;
            StartSpeed     = Speed;
            Acceleration   = newAcceleration;
            Color          = newAlpha;
            ColorChange    = newAlphaSpeed;
            TotalTime      = newMaxTime;
        }
Ejemplo n.º 30
0
        public static void UpdateInput(RenderTime elapsedTime, int ups)
        {
            if (CurrentInput.InputChanged)
            {
                InputTime += elapsedTime;
            }
            else
            {
                InputTime = RenderTime.FromMillisecs(0);
            }

            Display.Screen.UpdatesPerSecond = ups;
            ProcessMeta();
        }