当前位置: 首页>>代码示例>>C#>>正文


C# Graphics.RenderStates类代码示例

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


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

示例1: RenderStates

 ////////////////////////////////////////////////////////////
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="copy">States to copy</param>
 ////////////////////////////////////////////////////////////
 public RenderStates(RenderStates copy)
 {
     BlendMode = copy.BlendMode;
     Transform = copy.Transform;
     Texture = copy.Texture;
     Shader = copy.Shader;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:13,代码来源:RenderStates.cs

示例2: Initialize

        public void Initialize()
        {
            SelectedShader = new Shader(null, "Shader/SelectedShader.frag");
            SelectedState = new RenderStates(SelectedShader);

            AddControls();
        }
开发者ID:Kedreals,项目名称:MicrosoftGameJam2015AwesomeHurray,代码行数:7,代码来源:MainMenu.cs

示例3: Draw

 public void Draw(RenderTarget target, RenderStates states)
 {
     target.Draw(background, states);
     foreach (Layer l in layers) {
         target.Draw(l, states);
     }
 }
开发者ID:remy22,项目名称:game-1,代码行数:7,代码来源:Map.cs

示例4: RenderTarget

        public RenderTarget(SFML.Graphics.RenderTarget renderTarget)
        {
            this.renderTarget = renderTarget;
            m_VertexCache = new Vertex[CacheSize];

            m_RenderState = RenderStates.Default;
        }
开发者ID:pzaps,项目名称:CrossGFX,代码行数:7,代码来源:RenderTarget.cs

示例5: Deathmatch

        public Deathmatch()
            : base()
        {
            Projectiles = new List<Projectile>();
            BackgroundImages = new List<Sprite>();
            BackgroundImagesFar = new List<Sprite>();
            BackgroundTracks = new List<Sprite>();
            BackgroundGameObjects = new List<GameObject>();
            Players = new List<Actor>();
            Mailman = new ClientMailman(this);

            shader = new RenderStates(new Shader(null, "Content/bgPrlx.frag"));
            Image mapImg = new Image("Content/mapCol.png");
            mapBytes = mapImg.Pixels;
            mapSprite = new Sprite(new Texture(mapImg));
            mapWidth = (int)mapImg.Size.X;
            mapHeight = (int)mapImg.Size.Y;

            player = new ClientPlayer(this);
            player.Pos = new Vector2f(46, 62);
            Players.Add(player);

            trainSoundExterior = new SoundInstance(Content.GetSound("trainSpeed2.wav"), 1f, 0, 15, true);
            trainSoundInterior = new SoundInstance(Content.GetSound("trainSpeed0.wav"), 1, 0, 15, true);
            trainSound = trainSoundExterior;

            MainGame.Camera.Center = player.Pos - new Vector2f(0, 90);
        }
开发者ID:libjared,项目名称:iris,代码行数:28,代码来源:Deathmatch.cs

示例6: SFML

 /// <summary>
 /// Initializes a new instance of the <see cref="SFML"/> class.
 /// </summary>
 /// <param name="target">SFML render target.</param>
 public SFML(RenderTarget target)
 {
     m_Target = target;
     m_VertexCache = new Vertex[CacheSize];
     m_RenderState = new RenderStates(BlendMode.Alpha);
         // somehow worked without this in previous SFML version (May 9th 2010)
 }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:11,代码来源:SFML.cs

示例7: Draw

        public override void Draw(RenderTarget target, RenderStates states)
        {
            states.Transform *= Transform;
            graphic.Draw(target, states);

            base.Draw(target, states);
        }
开发者ID:ilezhnin,项目名称:Roguelike-like-like,代码行数:7,代码来源:Player.cs

示例8: Draw

        public void Draw(RenderTarget target, RenderStates states)
        {
            body.FillColor = data.FillColor;

            target.Draw(body);
            target.Draw(text);
        }
开发者ID:Cellmon95,项目名称:WarGames,代码行数:7,代码来源:ButtonRenderer.cs

示例9: Menu

        public Menu()
            : base()
        {
            hoverCursor = Content.GetTexture("cursorHover.png");
            defaultCursor = Content.GetTexture("cursorPointer.png");
            currentCursor = defaultCursor;
            char1 = new Animation(Content.GetTexture("idle.png"), 4, 0, 0, true);
            char2 = new Animation(Content.GetTexture("char2_idle.png"), 4, 0, 0, true);
            shader = new RenderStates(new Shader(null, "Content/bgPrlx.frag"));

            rectConnect = new RectangleShape()
            {
                Size = new Vector2f(150, 30),
                Position = new Vector2f(-25, 70)
            };
            rectIP = new RectangleShape()
            {
                Size = new Vector2f(150, 20),
                Position = new Vector2f(-25, 40)
            };
            rectUsername = new RectangleShape()
            {
                Size = new Vector2f(150, 20),
                Position = new Vector2f(-25, 10)
            };

            MainGame.window.TextEntered += TextEnteredEvent;
        }
开发者ID:libjared,项目名称:iris,代码行数:28,代码来源:Menu.cs

示例10: Draw

 public override void Draw(RenderTarget target, RenderStates states)
 {
     var sprite = sprites[type];
     sprite.Position = new Vector2f(x, y);
     sprite.Rotation = rotation;
     target.Draw(sprite);
 }
开发者ID:Rohansi,项目名称:Programe,代码行数:7,代码来源:NetAsteroid.cs

示例11: Draw

        public void Draw(RenderTarget target, RenderStates states)
        {
            states.Transform.Combine(Transform);

            target.Draw(m_QuadArray, states);
            target.Draw(m_LineArray, states);
        }
开发者ID:deanljohnson,项目名称:PathView,代码行数:7,代码来源:SquareGridBase.cs

示例12: Draw

        public void Draw(VertexArray vertices, RenderStates states) {
            if (!drawing) return;

            // Render states have changed, so flush and clear.
            if (!CompareStates(renderStates, states)) {
                Flush();
                vertexArray.Clear();
                renderStates = states;
            }

            // Exceeding maximum sprites, so flush and clear.
            if (DrawCount >= MaxSprites) {
                Flush();
                DrawCount = 0;
                vertexArray.Clear();
            }

            // Apply the transform to the four points
            var transform = states.Transform;
            
            // Append the vertices
            for (uint i = 0; i < vertices.VertexCount; i++) {
                var vertex = vertices[i];
                var pos = transform.TransformPoint(vertex.Position.X, vertex.Position.Y);
                vertex.Position.X = pos.X;
                vertex.Position.Y = pos.Y;
                vertexArray.Append(vertex);
            }

            DrawCount++;
            // I think that's it?
        }
开发者ID:KrissLaCross,项目名称:BreakOut,代码行数:32,代码来源:SpriteBatch.cs

示例13: Draw

        public void Draw(RenderTarget target, RenderStates states)
        {
            if (data.PictureSprite != null)
                curentPicture = data.PictureSprite;

            target.Draw(frame);
            target.Draw(curentPicture);
        }
开发者ID:Cellmon95,项目名称:WarGames,代码行数:8,代码来源:UnitPictureBoxRenderer.cs

示例14: Draw

        public void Draw(RenderTarget target, RenderStates states)
        {
            if (_dirty)
                Rebuild();

            states.Transform *= Transform;
            target.Draw(_vertices, states);
        }
开发者ID:Rohansi,项目名称:FPCompo11,代码行数:8,代码来源:TargetMarker.cs

示例15: Draw

 public void Draw(RenderTarget target, RenderStates states)
 {
     target.Draw(rectangleShape);
     target.Draw(unitPictureBoxRenderer);
     target.Draw(healthBarRenderer);
     target.Draw(MoveButtonRenderer);
     target.Draw(AttackButtonRenderer);
 }
开发者ID:Cellmon95,项目名称:WarGames,代码行数:8,代码来源:InterfaceBarRenderer.cs


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