本文整理汇总了C#中SFML.Graphics.RenderWindow.Draw方法的典型用法代码示例。如果您正苦于以下问题:C# RenderWindow.Draw方法的具体用法?C# RenderWindow.Draw怎么用?C# RenderWindow.Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFML.Graphics.RenderWindow
的用法示例。
在下文中一共展示了RenderWindow.Draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
RenderWindow window = new RenderWindow(new VideoMode(800, 600), "Test01");
window.Closed += (object sender, EventArgs e) => { (sender as Window).Close(); };
Font font = new Font("SnowflakeLetters.ttf");
Text text = new Text("BALD IST WEIHNACHTEN!", font);
Color col1 = new Color(123, 12, 12);
text.Position = new Vector2f(200, 200);
CircleShape shape = new CircleShape(20, 8);
shape.FillColor = Color.White;
shape.Position = new Vector2f(50, 50);
float a, c;
a = c = 50f;
while (window.IsOpen())
{
window.Clear(col1);
window.Draw(text);
if (Keyboard.IsKeyPressed(Keyboard.Key.Left) && a > 0)
a -= 0.1f;
if (Keyboard.IsKeyPressed(Keyboard.Key.Right) && a < window.Size.X - shape.Radius * 2)
a += 0.1f;
if (Keyboard.IsKeyPressed(Keyboard.Key.Down) && c < window.Size.Y - shape.Radius * 2)
c += 0.1f;
if (Keyboard.IsKeyPressed(Keyboard.Key.Up) && c > 0)
c -= 0.1f;
window.Draw(shape);
shape.Position = new Vector2f(a, c);
window.Display();
window.DispatchEvents();
}
}
示例2: Main
public static void Main(String[] args)
{
RenderWindow window = new RenderWindow(new VideoMode(1000, 700), "title");
RenderTexture tex = new RenderTexture(1000, 700);
Sprite texSprite = new Sprite(tex.Texture);
Fractal fractal = new Fractal();
fractal.CreateTreeFractal(500, 700, 3, 100, 0);
Console.WriteLine(fractal.Nodes.Count);
while (window.IsOpen())
{
window.Clear();
tex.Clear(new Color(0, 0, 0, 200
));
foreach (Shape s in fractal.Nodes)
{
window.Draw(s);
}
tex.Display();
window.Draw(texSprite);
window.Display();
Image img = window.Capture();
img.SaveToFile("C:/i.png");
Console.ReadLine();
}
}
示例3: Draw
public override void Draw(RenderWindow win, TimeSpan gameTime)
{
win.Draw(BackPlate);
win.Draw(LeftSide);
win.Draw(Center);
win.Draw(RightSide);
win.Draw(ButtonText);
}
示例4: Draw
public void Draw(RenderWindow window)
{
window.Draw(title);
for(int i = 0; i < 4; i++)
{
window.Draw(options[i]);
}
window.Draw(pointer);
}
示例5: Draw
override public void Draw(RenderWindow window)
{
//code to draw our text objects on the screen
window.Draw(title);
for (int i = 0; i < 4; i++)
{
window.Draw(options[i]);
}
window.Draw(pointer);
}
示例6: Draw
public override void Draw(RenderWindow context, AController controller)
{
Controller c = (Controller)controller;
foreach (Ball ball in c.Balls)
ball.Draw(context);
Text text = new Text("Splash Screen");
context.Draw(text);
context.Draw(Domey);
}
示例7: Draw
public void Draw(RenderWindow window)
{
if(!IsVisible()) return;
//Shadow
Position += new Vector2f(0, 1);
Color = Color.Black;
window.Draw(this, RenderStates.Default);
//Text
Position -= new Vector2f(0, 1);
Color = Config.Colors["text"];
window.Draw(this, RenderStates.Default);
}
示例8: draw
internal override void draw(RenderWindow window)
{
window.Draw(playerFrameSprite);
window.Draw(insideFrameSprite);
hpPercentText.DisplayedString = Math.Round(player.getHPpercent() * 100, 1) + "%";
window.Draw(hpPercentText);
//draw threat
int threatRank = parent.getInGame().getThreatRankOnMainEnemy(player);
if (threatRank != -1) {
threatText.DisplayedString = threatRank + "";
window.Draw(threatText);
}
}
示例9: Draw
internal void Draw(RenderWindow window)
{
window.Draw(bgSprite);
window.Draw(stripeSprite);
window.Draw(logoSprite);
play.draw(window);
leaderboard.draw(window);
stats.draw(window);
settings.draw(window);
help.draw(window);
exit.draw(window);
}
示例10: DrawAll
public static void DrawAll(ref RenderWindow window)
{
window.Clear();
window.DispatchEvents();
foreach (Shape s in shapeList)
window.Draw(s);
foreach (Sprite s in spriteList)
window.Draw(s);
window.Display();
}
示例11: draw
internal void draw(RenderWindow window)
{
pillarSprite.Position = new Vector2f(rect.Left,rect.Top);
pillarSprite.Texture = units.Count > 0 ? pillarUsed : pillarUnused;
window.Draw(pillarSprite);
int i=0;
foreach (ChampItemPair unit in units) {
//TODO EFF this must not efficient
unitSprite.Position = new Vector2f(rect.Left + (i++ * 50), rect.Top);
unitSprite.Texture = getUnitTexture(unit.hero);
window.Draw(unitSprite);
}
}
示例12: drawToolTip
internal void drawToolTip(RenderWindow window)
{
if (!hover) return;
if (disable) {
window.Draw(icon);
//spriteBatch.Draw(icon.text, icon.rect, Color.White);
return;
}
window.Draw(bgSprite);
window.Draw(icon);
window.Draw(titleText);
window.Draw(descText);
}
示例13: Main
public static void Main(string[] args)
{
window = new RenderWindow(new VideoMode(800, 600), "SFML window");
window.SetVisible(true);
window.SetVerticalSyncEnabled(true);
window.Closed += OnClosed;
window.MouseMoved += OnMouse;
window.MouseLeft += Window_MouseLeft;
window.Resized += Window_Resized;
List<Button> buttons = new List<Button>();
for (int i = 0; i < 10; i++)
{
buttons.Add(new Button(new Vector2f(i*200, 100), new Vector2f(75, 20)));
}
while (window.IsOpen)
{
window.DispatchEvents();
window.Clear(new Color(50, 50, 50));
GUIManager.GuiManager.Update(Mouse.GetPosition(window).X, Mouse.GetPosition(window).Y);
foreach (var item in buttons)
{
window.Draw(item);
}
window.Display();
}
}
示例14: Draw
public void Draw(RenderWindow win)
{
if(Sprite != null)
{
Sprite.Color = Color.White;
Sprite.Texture = StoneTexture;
win.Draw(Sprite);
var opacity = particleSwarm.Count >= 200 ? (byte) 255 :
(byte) (particleSwarm.Count);
Sprite.Color = new Color(255, 255, 255, opacity);
Sprite.Texture = opacity == 255 ? DotTexture : GlowTexture;
win.Draw(Sprite);
}
//DebugDraw(win);
}
示例15: Draw
public void Draw(RenderWindow window)
{
// Draw outer dark circle
CircleShape shape = new CircleShape(mass, 40);
shape.FillColor = new Color((byte)Math.Max(color.R - 50, 0), (byte)Math.Max(color.G - 50, 0), (byte)Math.Max(color.B - 50, 0));
shape.Position = new Vector2f(position.X - (ushort)mass, position.Y - (ushort)mass);
window.Draw(shape);
float diff = 4 + mass / 50;
// Draw inner circle
shape.Radius -= diff;
shape.FillColor = color;
shape.Position = new Vector2f(position.X - (ushort)mass + diff, position.Y - (ushort)mass + diff);
window.Draw(shape);
}