Jump to content
  • Advertisement
Sign in to follow this  
nickme

does sfml 2.0 support circle and rectangle as in ver 1.6?

This topic is 2478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi

i wrote a game in sfml 1.6 and it used sf::Shape::Circle(centerX, centerY, radius, fillColor, outline, outlineColor), and i wonder whether version 2.0 support it. i can not find it in sfml document. is there a replacement for those?

thanks.

Share this post


Link to post
Share on other sites
Advertisement
Yes and yes (assuming by support you mean making circle and rectangle shapes). Though the API has changed and you don't make a circle with sf::Shape::Circle, creating circle and rectangle shapes are supported. If, however, your question is "Can I make a circle/rectangle shape with sf::Shape::Circle/sf::Shape::Rectangle" the answer is no and no.

Share this post


Link to post
Share on other sites
Hidden

Yes and yes (assuming by support you mean making circle and rectangle shapes). Though the API has changed and you don't make a circle with sf::Shape::Circle, creating circle and rectangle shapes are supported. If, however, your question is "Can I make a circle/rectangle shape with sf::Shape::Circle/sf::Shape::Rectangle" the answer is no and no.


hi

how do i make the call to draw circle and rectangle? can ou give me some example.

suppose these are my codes.

App.Draw(sf::Shape::Line(10, 10, 710, 800, 15, sf::Color::Red));
App.Draw(sf::Shape::Circle(200, 200, 180, sf::Color::Yellow, 10, sf::Color::Blue));
App.Draw(sf::Shape::Rectangle(350, 200, 600, 350, sf::Color::Green));

how do i change it so it will compile in ver 2?

Share this post


Link to post

Yes and yes (assuming by support you mean making circle and rectangle shapes). Though the API has changed and you don't make a circle with sf::Shape::Circle, creating circle and rectangle shapes are supported. If, however, your question is "Can I make a circle/rectangle shape with sf::Shape::Circle/sf::Shape::Rectangle" the answer is no and no.


i printed out the documents. but i do not understand it. can you give me a few examples as to how to write a replacement codes for the following codes from my program?

App.Draw(sf::Shape::Line(10, 10, 710, 800, 15, sf::Color::Red));
App.Draw(sf::Shape::Circle(200, 200, 180, sf::Color::Yellow, 10, sf::Color::Blue));
App.Draw(sf::Shape::Rectangle(350, 200, 600, 350, sf::Color::Green));
Polygon.AddPoint(0, -50, sf::Color(255, 0, 0), sf::Color(0, 128, 128));

thanks

Share this post


Link to post
Share on other sites
The documentation for sfml2 has a sheet called "classes"

You can find examples there if you scroll down a little

http://www.sfml-dev....tangleShape.php


To draw points and lines in sfml2 you can look into the Draw function of the RenderWindow that takes an array of vertices

http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderTarget.php#a033df46bee2a3b39fb0c6a82f2aabcdd

http://www.sfml-dev.org/documentation/2.0/group__graphics.php#ga5ee56ac1339984909610713096283b1b

Share this post


Link to post
Share on other sites
hi pulpfist

thanks.

did you read my last post about the setting up sfml? i finally got it. what happened was that i got some advices from the web (not gamedev) that mentioned something about set that field to something. after i deleted it from there, everything work fine now.

thanks again.

Share this post


Link to post
Share on other sites
I see.

Maybe the folders in that field was used instead of the folders in "VC++ Directories"

I can see how that could be the problem

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!