本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Texture2D.ThrowIfNull方法的典型用法代码示例。如果您正苦于以下问题:C# Texture2D.ThrowIfNull方法的具体用法?C# Texture2D.ThrowIfNull怎么用?C# Texture2D.ThrowIfNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.Texture2D
的用法示例。
在下文中一共展示了Texture2D.ThrowIfNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WindowTexture
public WindowTexture(Texture2D texture, int spriteWidth, int spriteHeight)
{
texture.ThrowIfNull("texture");
_texture = texture;
_spriteWidth = spriteWidth;
_spriteHeight = spriteHeight;
_padding = new Padding(spriteWidth, spriteHeight);
_borderTopLeftRectangle = new Rectangle(0, 0, spriteWidth, spriteHeight);
_borderTopRectangle = new Rectangle(spriteWidth, 0, spriteWidth, spriteHeight);
_borderTopRightRectangle = new Rectangle(spriteWidth * 2, 0, spriteWidth, spriteHeight);
_borderRightRectangle = new Rectangle(spriteWidth * 2, spriteHeight, spriteWidth, spriteHeight);
_borderBottomRightRectangle = new Rectangle(spriteWidth * 2, spriteHeight * 2, spriteWidth, spriteHeight);
_borderBottomRectangle = new Rectangle(spriteWidth, spriteHeight * 2, spriteWidth, spriteHeight);
_borderBottomLeftRectangle = new Rectangle(0, spriteHeight * 2, spriteWidth, spriteHeight);
_borderTextureLeftRectangle = new Rectangle(0, spriteHeight, spriteWidth, spriteHeight);
_backgroundTopLeftRectangle = new Rectangle(0, spriteHeight * 3, spriteWidth, spriteHeight);
_backgroundTopRectangle = new Rectangle(spriteWidth, spriteHeight * 3, spriteWidth, spriteHeight);
_backgroundTopRightRectangle = new Rectangle(spriteWidth * 2, spriteHeight * 3, spriteWidth, spriteHeight);
_backgroundRightRectangle = new Rectangle(spriteWidth * 2, spriteHeight + (spriteHeight * 3), spriteWidth, spriteHeight);
_backgroundBottomRightRectangle = new Rectangle(spriteWidth * 2, (spriteHeight * 2) + (spriteHeight * 3), spriteWidth, spriteHeight);
_backgroundBottomRectangle = new Rectangle(spriteWidth, (spriteHeight * 2) + (spriteHeight * 3), spriteWidth, spriteHeight);
_backgroundBottomLeftRectangle = new Rectangle(0, (spriteHeight * 2) + (spriteHeight * 3), spriteWidth, spriteHeight);
_backgroundLeftRectangle = new Rectangle(0, spriteHeight + (spriteHeight * 3), spriteWidth, spriteHeight);
_backgroundCenterRectangle = new Rectangle(spriteWidth, spriteHeight + (spriteHeight * 3), spriteWidth, spriteHeight);
_upArrowRectangle = new Rectangle(spriteWidth * 3, 0, spriteWidth, spriteHeight);
_downArrowRectangle = new Rectangle(spriteWidth * 3, spriteHeight, spriteWidth, spriteHeight);
}