SFML community forums
Bindings - other languages => DotNet => Topic started by: joeparrilla on May 10, 2012, 05:59:30 am
-
Hey guys, Im probably missing something simple, but I cannot get this circle to display. Should I be calling the windows draw method like I am here, or do I call the circles draw and pass the window? Not sure whats going on...
namespace SFMLTEST
{ class Program
{ static void OnClose
(object sender, EventArgs e
) { // Close the window when OnClose event is received RenderWindow window
= (RenderWindow
)sender
; window
.Close(); } static void Main
(string[] args
) { // Create the main window RenderWindow window
= new RenderWindow
(new VideoMode
(800,
600),
"SFML window"); window
.Closed += new EventHandler
(OnClose
); // Create a graphical string to display Text text
= new Text
("Hello SFML.Net"); //Circle CircleShape ball
= new CircleShape
(200
.0f
); ball
.FillColor = new Color
(Color
.Magenta); ball
.Position = new Vector2f
(100
.0f, 100
.0f
); // Start the game loop while (window
.IsOpen()) { // Process events window
.DispatchEvents(); // Clear screen window
.Clear(); // Draw the string window
.Draw(text
); // Draw Ball window
.Draw(ball
); // Update the window window
.Display(); } } }}
-
There was a bug, it's now fixed. Thanks for your feedback.
If you want to make it work without recompiling SFML, just avoid the CircleShape(radius) constructor (so either use CircleShape(radius, pointCount) or SetPointCount).
-
...use CircleShape(radius, pointCount) or SetPointCount).
I have not recompile SFML and use the RC version.
CircleShape s
= new CircleShape
();s
.SetPointCount(60); //Doesn't workCircleShape s
= new CircleShape
();s
.Radius = 60; //Work
-
Sorry, I meant Radius, not SetPointCount :-[
-
Thanks Laurent :)