Пример #1
0
        public override void LoadContent()
        {
            texture = OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bullets\OrangeMine");
            baseMask = new HitboxMask(texture.Height, texture.Height, texture.Height / 2, texture.Height / 2);
            TurnetImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Players\Weapons\Mine"));
            TurnetImage.OriginX = 0;
            TurnetImage.OriginY = TurnetImage.Height / 2;

            base.LoadContent();
        }
Пример #2
0
        public static void DrawHitbox(Vector2 position, HitboxMask mask, Color borderColor)
        {
            SpriteBatch.Begin();

            Vector2 cameraPosition = WorldCamera.ConvertToCamera(new Vector2(mask.Hitbox.X + position.X, mask.Hitbox.Y + position.Y));

            spriteBatch.Draw(pixelTest, new Rectangle((int)cameraPosition.X, (int)cameraPosition.Y, mask.Hitbox.Width, mask.Hitbox.Height),
                borderColor);

            SpriteBatch.End();
        }