• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ColourValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ColourValue的典型用法代码示例。如果您正苦于以下问题:C# ColourValue类的具体用法?C# ColourValue怎么用?C# ColourValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ColourValue类属于命名空间,在下文中一共展示了ColourValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddTextBox

        public static void AddTextBox(String id, String text, float x, float y, float width, float height, ColourValue colorTop, ColourValue colorBot)
        {
            try {
                OverlayManager overlayMgr = OverlayManager.Singleton;
                OverlayContainer panel = (OverlayContainer)overlayMgr.CreateOverlayElement("Panel", "_panel_" + id);
                panel.MetricsMode = GuiMetricsMode.GMM_PIXELS;
                panel.SetPosition(x, y);
                panel.SetDimensions(width, height);

                TextAreaOverlayElement textArea = (TextAreaOverlayElement)overlayMgr.CreateOverlayElement("TextArea", "_area_" + id);
                textArea.MetricsMode = GuiMetricsMode.GMM_PIXELS;
                textArea.SetPosition(0, 0);
                textArea.SetDimensions(width, height);
                textArea.Caption = text;
                textArea.CharHeight = 16;
                textArea.FontName = "Verdana";
                textArea.ColourTop = colorTop;
                textArea.ColourBottom = colorBot;
                Overlay overlay = overlayMgr.Create("_overlay_" + id);
                overlay.Add2D(panel);
                panel.AddChild(textArea);
                overlay.Show();
            }
            catch (Exception e) {
                Util.Log("Unable to create text area.");
            }
        }
开发者ID:andyhebear,项目名称:ymfas,代码行数:27,代码来源:TextRenderer.cs


示例2: CreateScene

        public override void CreateScene()
        {
            ColourValue fadeColour = new ColourValue(0.9f, 0.9f, 0.9f);
            base.sceneMgr.SetFog(FogMode.FOG_LINEAR, fadeColour, 0, 100, 900);
            //base.sceneMgr.SetFog(FogMode.FOG_EXP, fadeColour, 0.009f);
            base.viewport.BackgroundColour = fadeColour;

            Plane plane;
            plane.d = 100;
            plane.normal = Vector3.NEGATIVE_UNIT_Y;

            base.sceneMgr.SetWorldGeometry("terrain.cfg");
            base.sceneMgr.SetSkyPlane(true, plane, "Examples/CloudySky", 500, 20, true, 0.5f, 150, 150);

            //FSLSoundObject backgroundSound = soundManager.CreateAmbientSound("../../media/sound/windy1.ogg", "Ambiente1", true); //Create Ambient sound
            //backgroundSound.Play();

            //BoidMesh.CreateBoidMesh("myBoid_green", "green");
            //BoidMesh.CreateBoidMesh("myBoid_red", "red");

            boidNodesList = new List<SceneNode>();
            for (int i = 0; i < boidsManager.KnownBoidsList.Count; i++)
            {
                AddNewBoid(boidsManager.KnownBoidsList[i]);
            }
            boidsManager.OnNewBoid += new AddNewBoid(AddNewBoid);
        }
开发者ID:superliujian,项目名称:Sxta,代码行数:27,代码来源:BoidsSample.cs


示例3: SetFog

 private void SetFog()
 {
     ColourValue fadeColour = new ColourValue(0.1f, 0.1f, 1f);
     //mSceneMgr.SetFog(FogMode.FOG_LINEAR, fadeColour, 0.1f, 100, 1000);
     //mSceneMgr.SetFog(FogMode.FOG_EXP, fadeColour, 0.001f);
     mSceneMgr.SetFog(FogMode.FOG_EXP2, fadeColour, 0.002f);
     mWindow.GetViewport(0).BackgroundColour = fadeColour;
 }
开发者ID:Bobbylon5,项目名称:Mogre14,代码行数:8,代码来源:Env.cs


示例4: NewTextLabel3D

        public TextLabel3D NewTextLabel3D(
            String fontName, float fontSize, ColourValue colourtop, ColourValue colourbottom, int layer)
        {
            TextLabel3D textLabel = new TextLabel3D(
              GetUniqueLabelName(), fontName, fontSize, colourtop, colourbottom);

            Panels[layer].AddChild(textLabel.TextArea);
            Labels.Add(textLabel);

            return textLabel;
        }
开发者ID:janPierdolnikParda,项目名称:WorldCreator,代码行数:11,代码来源:TextLabeler.cs


示例5: NewSimpleQuad

        public SimpleQuad NewSimpleQuad(string materialName, float left, float top,
                            float width, float height, ColourValue colour, int layer)
        {
            SimpleQuad quad = new SimpleQuad(GetUniqueLabelName(), materialName,
              left, top, width, height, colour);

            Overlays[layer].Add2D(quad.Panel);
            Quads.Add(quad);

            return quad;
        }
开发者ID:janPierdolnikParda,项目名称:WorldCreator,代码行数:11,代码来源:TextLabeler.cs


示例6: SimpleQuad

 public SimpleQuad(String name, String materialName,
     float left, float top, float width,
     float height, ColourValue colour)
 {
     Panel = OverlayManager.Singleton.CreateOverlayElement("Panel", name)
       as OverlayContainer;
     Panel.MetricsMode = GuiMetricsMode.GMM_RELATIVE;
     Panel.SetDimensions(width, height);
     Panel.SetPosition(left, top);
     Panel.MaterialName = materialName;
     Panel.Colour = colour;
 }
开发者ID:janPierdolnikParda,项目名称:RPG,代码行数:12,代码来源:SimpleQuad.cs


示例7: AddToVertices

    public int AddToVertices(LinkedList<KeyValuePair<Vector3, ColourValue>> tarGet, Vector3 position, ColourValue colour, float scale)
    {
        Matrix4 transform = Matrix4.IDENTITY;
        transform.SetTrans(position);
        transform.SetScale(new Vector3(scale, scale, scale));

        for (int i = 0; i <= System.Convert.ToInt32(vertices.Count) - 1; i++) {
            tarGet.AddLast(new KeyValuePair<Vector3, ColourValue>(transform * vertices[i], colour));
        }

        return vertices.Count;
    }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:12,代码来源:MogreDebugDrawer.cs


示例8: CreateScene

        // Just override the mandatory create scene method
        public override void CreateScene()
        {
            // Set ambient light
            sceneMgr.AmbientLight = new ColourValue(0.5f, 0.5f, 0.5f);

            // Create a light
            Light l = sceneMgr.CreateLight("MainLight");
            // Accept default settings: point light, white diffuse, just set position
            // NB I could attach the light to a SceneNode if I wanted it to move automatically with
            //  other objects, but I don't
            l.SetPosition(20,80,50);

            // Fog
            // NB it's VERY important to set this before calling setWorldGeometry
            // because the vertex program picked will be different
            ColourValue fadeColour = new ColourValue(0.93f, 0.86f, 0.76f);
            sceneMgr.SetFog(FogMode.FOG_LINEAR, fadeColour, .001f, 500, 1000);
            window.GetViewport(0).BackgroundColour = fadeColour;

            string terrain_cfg = "terrain.cfg";
            sceneMgr.SetWorldGeometry( terrain_cfg );
            // Infinite far plane?
            if (root.RenderSystem.Capabilities.HasCapability(Capabilities.RSC_INFINITE_FAR_PLANE))
            {
                camera.FarClipDistance = 0;
            }

            // Define the required skyplane
            Plane plane;
            // 5000 world units from the camera
            plane.d = 5000;
            // Above the camera, facing down
            plane.normal = -Vector3.UNIT_Y;

            // Set a nice viewpoint
            camera.SetPosition(707,2500,528);
            camera.Orientation = new Quaternion(-0.3486f, 0.0122f, 0.9365f, 0.0329f);
            //mRoot -> showDebugOverlay( true );

            raySceneQuery = sceneMgr.CreateRayQuery(
                new Ray(camera.Position, Vector3.NEGATIVE_UNIT_Y));
        }
开发者ID:andyhebear,项目名称:mogresdk,代码行数:43,代码来源:TerrainApplication.cs


示例9: updateMenu

        public void updateMenu()
        {
            spinCounter += 0.04f;

            seltop = new ColourValue((Mogre.Math.Sin(spinCounter) + 1)/2, 0.7f, 0.7f);

            for (int i = 0; i < 10; i++)
            {
                optionAreas[i].ColourTop = top;
                optionAreas[i].ColourBottom = bot;
            }

            optionAreas[Program.Instance.gameManager.menuOption].ColourBottom = selbot;
            optionAreas[Program.Instance.gameManager.menuOption].ColourTop = seltop;
        }
开发者ID:CharcoalStyles,项目名称:3DRL,代码行数:15,代码来源:overlayGUI.cs


示例10: ImageFromColour

 public static BitmapImage ImageFromColour(ColourValue clr)
 {
     return bmps[(int)clr];
 }
开发者ID:voyovoda,项目名称:wpfBreakout,代码行数:4,代码来源:Class1.cs


示例11: DrawTriangle

        /// <param name="__unnamed004">alpha?</param>
        public void DrawTriangle(Vector3 v0, Vector3 v1, Vector3 v2, ColourValue colour, float __unnamed004)
        {
            if (DrawCondition(v0))
                return;

            triangles.Position(v0);
            triangles.Colour(colour);
            triangles.Position(v1);
            triangles.Colour(colour);
            triangles.Position(v2);
            triangles.Colour(colour);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:13,代码来源:BulletDebugDrawer.cs


示例12: DrawSphere

        /// <summary>
        /// Draws a sphere that does rotate
        /// </summary>
        public void DrawSphere(float radius, Matrix4 transform, ColourValue colour)
        {
            if (DrawCondition(transform))
                return;

            Vector3 previousXYPos = transform * new Vector3(0, radius, 0);
            Vector3 previousYZPos = transform * new Vector3(0, radius, 0);
            Vector3 previousXZPos = transform * new Vector3(0, 0, radius);

            for (float a = 0; a <= limit; a += increaseAmount) {
                float y = Math.Cos(a) * radius;
                float x = Math.Sin(a) * radius;

                // xy
                Vector3 xyPos = transform * new Vector3(x, y, 0);
                lines.Position(previousXYPos);
                lines.Colour(colour);
                lines.Position(xyPos);
                lines.Colour(colour);
                previousXYPos = xyPos;

                // yz
                float z = Math.Sin(a) * radius;

                Vector3 yzPos = transform * new Vector3(0, y, z);
                lines.Position(previousYZPos);
                lines.Colour(colour);
                lines.Position(yzPos);
                lines.Colour(colour);
                previousYZPos = yzPos;

                // xz
                z = Math.Cos(a) * radius;

                Vector3 xzPos = transform * new Vector3(x, 0, z);
                lines.Position(previousXZPos);
                lines.Colour(colour);
                lines.Position(xzPos);
                lines.Colour(colour);
                previousXZPos = xzPos;
            }
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:45,代码来源:BulletDebugDrawer.cs


示例13: DrawLine

        /// <summary>
        /// Draws a line
        /// </summary>
        public void DrawLine(Vector3 from, Vector3 to, ColourValue fromcolour, ColourValue tocolour)
        {
            if (DrawCondition(from))
                return;

            lines.Position(from);
            lines.Colour(fromcolour);
            lines.Position(to);
            lines.Colour(tocolour);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:13,代码来源:BulletDebugDrawer.cs


示例14: DrawContactPoint

        /// <summary>
        /// This doesn't seem to even work half the time
        /// </summary>
        public void DrawContactPoint(Vector3 pointOnB, Vector3 normalOnB, float distance, int lifeTime, ColourValue colour)
        {
            //if (DrawCondition(pointOnB))
            //	return;

            lines.Position(pointOnB);
            lines.Colour(colour);
            lines.Position(pointOnB + normalOnB * distance);
            lines.Colour(colour);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:13,代码来源:BulletDebugDrawer.cs


示例15: DrawBox

        public void DrawBox(Vector3 bbMin, Vector3 bbMax, ColourValue colour)
        {
            if (DrawCondition(bbMin))
                return;

            Vector3 loo = new Vector3(bbMin.x, bbMax.y, bbMax.z);
            Vector3 olo = new Vector3(bbMax.x, bbMin.y, bbMax.z);
            Vector3 ool = new Vector3(bbMax.x, bbMax.y, bbMin.z);
            Vector3 llo = new Vector3(bbMin.x, bbMin.y, bbMax.z);
            Vector3 lol = new Vector3(bbMin.x, bbMax.y, bbMin.z);
            Vector3 oll = new Vector3(bbMax.x, bbMin.y, bbMin.z);

            lines.Position(bbMax); lines.Colour(colour);
            lines.Position(loo); lines.Colour(colour);
            lines.Position(bbMax); lines.Colour(colour);
            lines.Position(olo); lines.Colour(colour);
            lines.Position(bbMax); lines.Colour(colour);
            lines.Position(ool); lines.Colour(colour);

            lines.Position(bbMin); lines.Colour(colour);
            lines.Position(llo); lines.Colour(colour);
            lines.Position(bbMin); lines.Colour(colour);
            lines.Position(lol); lines.Colour(colour);
            lines.Position(bbMin); lines.Colour(colour);
            lines.Position(oll); lines.Colour(colour);

            lines.Position(loo); lines.Colour(colour);
            lines.Position(lol); lines.Colour(colour);
            lines.Position(lol); lines.Colour(colour);
            lines.Position(ool); lines.Colour(colour);
            lines.Position(ool); lines.Colour(colour);
            lines.Position(oll); lines.Colour(colour);
            lines.Position(oll); lines.Colour(colour);
            lines.Position(olo); lines.Colour(colour);
            lines.Position(olo); lines.Colour(colour);
            lines.Position(llo); lines.Colour(colour);
            lines.Position(llo); lines.Colour(colour);
            lines.Position(loo); lines.Colour(colour);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:39,代码来源:BulletDebugDrawer.cs


示例16: DrawCapsule

        /// <summary>
        /// Draws a cylinder, then draws two half-spheres on the top and bottom
        /// </summary>
        public void DrawCapsule(float radius, float halfHeight, int upAxis, Matrix4 transform, ColourValue colour)
        {
            if (DrawCondition(transform))
                return;

            DrawCylinder(radius, halfHeight, upAxis, transform, colour);

            Vector3 previousXYPos = transform * new Vector3(radius, halfHeight, 0);
            Vector3 previousYZPos = transform * new Vector3(0, halfHeight, radius);
            Vector3 previousNXYPos = transform * new Vector3(radius, -halfHeight, 0);
            Vector3 previousNYZPos = transform * new Vector3(0, -halfHeight, radius);

            float capsuleLimit = limit * 0.5f;

            // y-x circle
            for (float a = 0; a <= capsuleLimit; a += increaseAmount) {
                float y = Math.Sin(a) * radius;
                float x = Math.Cos(a) * radius;

                // xy
                Vector3 xyPos = transform * new Vector3(x, y + halfHeight, 0);
                lines.Position(previousXYPos);
                lines.Colour(colour);
                lines.Position(xyPos);
                lines.Colour(colour);
                previousXYPos = xyPos;

                // yz
                float z = Math.Cos(a) * radius;

                Vector3 yzPos = transform * new Vector3(0, y + halfHeight, z);
                lines.Position(previousYZPos);
                lines.Colour(colour);
                lines.Position(yzPos);
                lines.Colour(colour);
                previousYZPos = yzPos;

                // -xy
                Vector3 nxyPos = transform * new Vector3(x, -y - halfHeight, 0);
                lines.Position(previousNXYPos);
                lines.Colour(colour);
                lines.Position(nxyPos);
                lines.Colour(colour);
                previousNXYPos = nxyPos;

                // -yz
                Vector3 nyzPos = transform * new Vector3(0, -y - halfHeight, z);
                lines.Position(previousNYZPos);
                lines.Colour(colour);
                lines.Position(nyzPos);
                lines.Colour(colour);
                previousNYZPos = nyzPos;
            }
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:57,代码来源:BulletDebugDrawer.cs


示例17: CircleTexture

 //    *
 //	Default constructor.
 //	\param pBuffer Image buffer where to modify the image.
 //	
 public CircleTexture(TextureBuffer pBuffer)
     : base(pBuffer, "CircleTexture") {
     mColour = ColourValue.White;
     mRadius = (int)System.Math.Min(pBuffer.getWidth(), pBuffer.getHeight()) / 2;
     mX = mRadius;
     mY = mRadius;
 }
开发者ID:andyhebear,项目名称:mogre-procedural,代码行数:11,代码来源:ProceduralTextureModifiers.cs


示例18: DrawCylinder

        /// <summary>
        /// Draws a cylinder
        /// </summary>
        /// <param name="upAxis">
        /// no idea what this is even for
        /// </param>
        public void DrawCylinder(float radius, float halfHeight, int upAxis, Matrix4 transform, ColourValue colour)
        {
            if (DrawCondition(transform))
                return;

            Vector3 previousPos = transform * new Vector3(0, halfHeight, radius);
            Vector3 previousNPos = transform * new Vector3(0, -halfHeight, radius);

            for (float a = 0; a <= limit; a += increaseAmount) {
                float z = Math.Cos(a) * radius;
                float x = Math.Sin(a) * radius;

                // positive
                Vector3 pos = transform * new Vector3(x, halfHeight, z);
                lines.Position(previousPos);
                lines.Colour(colour);
                lines.Position(pos);
                lines.Colour(colour);
                previousPos = pos;

                // negative
                Vector3 npos = transform * new Vector3(x, -halfHeight, z);
                lines.Position(previousNPos);
                lines.Colour(colour);
                lines.Position(npos);
                lines.Colour(colour);
                previousNPos = npos;

                // the sides
                lines.Position(pos);
                lines.Colour(colour);
                lines.Position(npos);
                lines.Colour(colour);
            }
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:41,代码来源:BulletDebugDrawer.cs


示例19: setColour

        //    *
        //	Set the fill colour of the circle.
        //	\param colour New colour for processing (default Ogre::ColourValue::White)
        //	

        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public CircleTexture setColour(ColourValue colour) {
            //
            //ORIGINAL LINE: mColour = colour;
            mColour = (colour);
            return this;
        }
开发者ID:andyhebear,项目名称:mogre-procedural,代码行数:13,代码来源:ProceduralTextureModifiers.cs


示例20: DrawPlane

 public void DrawPlane(Vector3 planeNormal, float planeConst, Matrix4 transform, ColourValue colour)
 {
 }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:3,代码来源:BulletDebugDrawer.cs



注:本文中的ColourValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Column类代码示例发布时间:2022-05-24
下一篇:
C# Colour类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap