本文整理汇总了C#中Rectangle2D.SetCorners方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle2D.SetCorners方法的具体用法?C# Rectangle2D.SetCorners怎么用?C# Rectangle2D.SetCorners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rectangle2D
的用法示例。
在下文中一共展示了Rectangle2D.SetCorners方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create2DElement
public static void Create2DElement(String name, String texture, Vector2 TopLeft, Vector2 BottomRight)
{
MaterialPtr material = MaterialManager.Singleton.Create(name, "General");
material.GetTechnique(0).GetPass(0).CreateTextureUnitState(texture);
material.GetTechnique(0).GetPass(0).DepthCheckEnabled = false;
material.GetTechnique(0).GetPass(0).DepthWriteEnabled = false;
material.GetTechnique(0).GetPass(0).LightingEnabled = false;
// Create background rectangle covering the whole screen
Rectangle2D rect = new Rectangle2D(true);
rect.SetCorners(TopLeft.x * 2 - 1, 1 - TopLeft.y * 2, BottomRight.x * 2 - 1, 1 - BottomRight.y * 2);
//rect.SetCorners(-1.0f, 1.0f, 1.0f, -1.0f);
rect.SetMaterial(name);
// Render the background before everything else
rect.RenderQueueGroup = (byte)RenderQueueGroupID.RENDER_QUEUE_OVERLAY;
// Use infinite AAB to always stay visible
AxisAlignedBox aab = new AxisAlignedBox();
aab.SetInfinite();
rect.BoundingBox = aab;
// Attach background to the scene
SceneNode node = _OgreEngine.mMgr.RootSceneNode.CreateChildSceneNode("2D__" + name);
node.AttachObject(rect);
}