本文整理汇总了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;
}
示例2: Initialize
public void Initialize()
{
SelectedShader = new Shader(null, "Shader/SelectedShader.frag");
SelectedState = new RenderStates(SelectedShader);
AddControls();
}
示例3: Draw
public void Draw(RenderTarget target, RenderStates states)
{
target.Draw(background, states);
foreach (Layer l in layers) {
target.Draw(l, states);
}
}
示例4: RenderTarget
public RenderTarget(SFML.Graphics.RenderTarget renderTarget)
{
this.renderTarget = renderTarget;
m_VertexCache = new Vertex[CacheSize];
m_RenderState = RenderStates.Default;
}
示例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);
}
示例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)
}
示例7: Draw
public override void Draw(RenderTarget target, RenderStates states)
{
states.Transform *= Transform;
graphic.Draw(target, states);
base.Draw(target, states);
}
示例8: Draw
public void Draw(RenderTarget target, RenderStates states)
{
body.FillColor = data.FillColor;
target.Draw(body);
target.Draw(text);
}
示例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;
}
示例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);
}
示例11: Draw
public void Draw(RenderTarget target, RenderStates states)
{
states.Transform.Combine(Transform);
target.Draw(m_QuadArray, states);
target.Draw(m_LineArray, states);
}
示例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?
}
示例13: Draw
public void Draw(RenderTarget target, RenderStates states)
{
if (data.PictureSprite != null)
curentPicture = data.PictureSprite;
target.Draw(frame);
target.Draw(curentPicture);
}
示例14: Draw
public void Draw(RenderTarget target, RenderStates states)
{
if (_dirty)
Rebuild();
states.Transform *= Transform;
target.Draw(_vertices, states);
}
示例15: Draw
public void Draw(RenderTarget target, RenderStates states)
{
target.Draw(rectangleShape);
target.Draw(unitPictureBoxRenderer);
target.Draw(healthBarRenderer);
target.Draw(MoveButtonRenderer);
target.Draw(AttackButtonRenderer);
}