예제 #1
0
파일: DrawHelper.cs 프로젝트: JWeel/Hex
        public Vector2 DrawTextureWithOffset(Vector2 position, string asset, Color blend, AlignOffset align = AlignOffset.TopLeft)
        {
            var texture = LoadTexture(asset);
            var offset  = Vector2.Zero;

            switch (align)
            {
            case AlignOffset.TopRight: offset = new Vector2(-texture.Width, 0); break;

            case AlignOffset.BottomLeft: offset = new Vector2(0, -texture.Height); break;

            case AlignOffset.BottomRight: offset = new Vector2(-texture.Width, -texture.Height); break;
            }

            _spriteBatch.Draw(texture, position + offset, blend);
            return(new Vector2(texture.Width, texture.Height));
        }
예제 #2
0
파일: DrawHelper.cs 프로젝트: JWeel/Hex
 public Vector2 DrawTextureWithOffset(Vector2 position, string asset, AlignOffset align = AlignOffset.TopLeft)
 {
     return(DrawTextureWithOffset(position, asset, Color.White, align));
 }