コード例 #1
0
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         BorderTexture = null;
         CornerTexture.Dispose();
         CornerTexture = null;
         CornerLTexture.Dispose();
         CornerLTexture = null;
         NeoTexture     = null;
         base.Dispose();
     }
 }
コード例 #2
0
 public void SetBorderTextures(Texture2D borderTexture, string cornerTextureString, string cornerLTextureString)
 {
     BorderTexture = borderTexture;
     CornerTexture.ChangeSprite(cornerTextureString);
     CornerLTexture.ChangeSprite(cornerLTextureString);
 }
コード例 #3
0
 public void DrawCorners(Camera2D camera)
 {
     CornerTexture.TextureColor  = TextureColor;
     CornerLTexture.TextureColor = TextureColor;
     CornerLTexture.Flip         = SpriteEffects.None;
     CornerTexture.Flip          = SpriteEffects.None;
     CornerLTexture.Rotation     = 0f;
     if (BorderTop)
     {
         if (BorderRight)
         {
             CornerLTexture.Position = new Vector2(Bounds.Right - CornerLTexture.Width, Bounds.Top);
             CornerLTexture.Draw(camera);
         }
         else
         {
             CornerTexture.Position = new Vector2(Bounds.Right - CornerTexture.Width, Bounds.Top);
             CornerTexture.Draw(camera);
         }
         CornerLTexture.Flip = SpriteEffects.FlipHorizontally;
         CornerTexture.Flip  = SpriteEffects.FlipHorizontally;
         if (BorderLeft)
         {
             CornerLTexture.Position = new Vector2(Bounds.Left + CornerLTexture.Width, Bounds.Top);
             CornerLTexture.Draw(camera);
         }
         else
         {
             CornerTexture.Position = new Vector2(Bounds.Left + CornerTexture.Width, Bounds.Top);
             CornerTexture.Draw(camera);
         }
     }
     if (BorderBottom)
     {
         CornerTexture.Flip  = SpriteEffects.FlipVertically;
         CornerLTexture.Flip = SpriteEffects.FlipVertically;
         if (BorderRight)
         {
             CornerLTexture.Position = new Vector2(Bounds.Right - CornerLTexture.Width,
                                                   Bounds.Bottom - CornerLTexture.Height);
             CornerLTexture.Draw(camera);
         }
         else
         {
             CornerTexture.Flip     = SpriteEffects.FlipVertically;
             CornerTexture.Position = new Vector2(Bounds.Right - CornerTexture.Width,
                                                  Bounds.Bottom - CornerTexture.Height);
             CornerTexture.Draw(camera);
         }
         if (BorderLeft)
         {
             CornerLTexture.Position = new Vector2(Bounds.Left + CornerLTexture.Width,
                                                   Bounds.Bottom - CornerLTexture.Height);
             CornerLTexture.Rotation = 90f;
             CornerLTexture.Draw(camera);
             CornerLTexture.Rotation = 0f;
         }
         else
         {
             CornerTexture.Flip     = SpriteEffects.None;
             CornerTexture.Position = new Vector2(Bounds.Left + CornerTexture.Width, Bounds.Bottom);
             CornerTexture.Rotation = 180f;
             CornerTexture.Draw(camera);
             CornerTexture.Rotation = 0f;
         }
     }
     if (BorderLeft)
     {
         CornerTexture.Flip  = SpriteEffects.None;
         CornerLTexture.Flip = SpriteEffects.None;
         if (!BorderBottom)
         {
             CornerTexture.Position = new Vector2(Bounds.Left, Bounds.Bottom - CornerTexture.Width);
             CornerTexture.Flip     = SpriteEffects.FlipHorizontally;
             CornerTexture.Rotation = -90f;
             CornerTexture.Draw(camera);
             CornerTexture.Rotation = 0f;
         }
         if (!BorderTop)
         {
             CornerTexture.Position = new Vector2(Bounds.Left, Bounds.Top + CornerTexture.Width);
             CornerTexture.Flip     = SpriteEffects.None;
             CornerTexture.Rotation = -90f;
             CornerTexture.Draw(camera);
             CornerTexture.Rotation = 0f;
         }
     }
     if (BorderRight)
     {
         CornerTexture.Flip  = SpriteEffects.None;
         CornerLTexture.Flip = SpriteEffects.None;
         if (!BorderBottom)
         {
             CornerTexture.Position = new Vector2(Bounds.Right, Bounds.Bottom - CornerTexture.Width);
             CornerTexture.Rotation = 90f;
             CornerTexture.Draw(camera);
             CornerTexture.Rotation = 0f;
         }
         if (!BorderTop)
         {
             CornerTexture.Position = new Vector2(Bounds.Right, Bounds.Top + CornerTexture.Width);
             CornerTexture.Flip     = SpriteEffects.FlipHorizontally;
             CornerTexture.Rotation = 90f;
             CornerTexture.Draw(camera);
             CornerTexture.Rotation = 0f;
         }
     }
 }