Ejemplo n.º 1
0
        public static Vector2 PolarPos(Vector2 Point, float Distance, float Angle, int XOffset = 0, int YOffset = 0)
        {
            var ReturnedValue = new Vector2();

            ReturnedValue.X = (Distance * (float)Math.Sin((double)AntiarisHelper.RadtoGrad(Angle)) + Point.X) + XOffset;
            ReturnedValue.Y = (Distance * (float)Math.Cos((double)AntiarisHelper.RadtoGrad(Angle)) + Point.Y) + YOffset;
            return(ReturnedValue);
        }
Ejemplo n.º 2
0
        private static void _drawIcons(Mod mod, SpriteBatch spriteBatch)
        {
            ReLogic.Content.Asset <Texture2D> chest  = mod.GetTexture("Items/Equipables/Accessories/ChestIcon");
            ReLogic.Content.Asset <Texture2D> chest_ = mod.GetTexture("Items/Equipables/Accessories/ChestIcon2");
            var startPosition = new Vector2();

            foreach (Point chest2 in chestTiles)
            {
                startPosition = AntiarisHelper.FoundPosition(new Vector2(chest2.X + 1f, chest2.Y + 1f));
                var newStartPosition = new Rectangle((int)startPosition.X, (int)startPosition.Y, chest.Width, chest.Height);
                spriteBatch.Draw(chest, newStartPosition, null, Color.White, 0f, new Vector2(chest.Width / 2, chest.Height / 2), SpriteEffects.None, 0f);
            }
            foreach (Point chest2_ in chestTiles2)
            {
                startPosition = AntiarisHelper.FoundPosition(new Vector2(chest2_.X + 1f, chest2_.Y + 1f));
                var newStartPosition = new Rectangle((int)startPosition.X, (int)startPosition.Y, chest_.Width, chest_.Height);
                spriteBatch.Draw(chest_, newStartPosition, null, Color.White, 0f, new Vector2(chest_.Width / 2, chest_.Height / 2), SpriteEffects.None, 0f);
            }
        }