Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rajhansk

Pages: [1] 2
1
Graphics / Re: is there anyway to create a fancy Console window in sfml ?
« on: October 31, 2017, 05:06:55 pm »
Thanks

2
Graphics / Image gets distorted when maximize button is hit
« on: October 31, 2017, 04:54:36 am »
I have  an image of 640x480. when I hit maximize button the whole image gets distorted. How do I keep the image un-stretched when window is maximized ?

3
Graphics / is there anyway to create a fancy Console window in sfml ?
« on: October 31, 2017, 03:37:10 am »
I wanted to create another console window for my calligraphy project. The standard code blocks window does not look that attractive. My question is , is there anyway to create new colorful and attractive console window ?

Any help will be appreciated.
Thanks you.

4
General / I want to display this car image but I am getting an error
« on: October 23, 2017, 04:38:54 pm »
I am getting an error saying "error: ld returned 1 exit status"

#include <SFML/Graphics.hpp>
#include<iostream>
using namespace std;
int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 200), "SFML works!");
   // sf::CircleShape shape(100.f);
  //  shape.setFillColor(sf::Color::Green);
    sf::Image image;
    image.create(640,480,sf::Color::Blue);
    sf::Texture texture;
    if(!texture.loadFromFile("car.png"))
        return EXIT_FAILURE;

    sf::Sprite sprite;
    sprite.setTexture(texture);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(sprite);
        window.display();
    }

    return 0;
}


5
SFML projects / How do I export coral draw file into sfml project?
« on: October 22, 2017, 09:19:56 am »
I am making a simple project and in that I have to import only the drawn part into a window that means I do not want the white background. How do I import this to sfml window ?

what classes should I use ? and How do I do this ?

6
Graphics / Re: How Do I change background color of my window?
« on: September 05, 2017, 03:45:45 pm »
Anyway, back to my question,

Can you guide regarding this?

How do I read the documentation of SFML??

That will be really helpful.

7
Graphics / Re: How Do I change background color of my window?
« on: September 05, 2017, 03:35:26 pm »
I am learning :) :) :)

8
Graphics / Re: How Do I change background color of my window?
« on: September 05, 2017, 03:24:52 pm »
I mean in this following line what is in the bracket ?? what should I type in here, should I just type the name of color or should I write the color codes??
void sf::RenderTarget::clear(const Color &    color = Color(0, 0, 0, 255)   )

9
Graphics / Re: How Do I change background color of my window?
« on: September 05, 2017, 03:14:40 pm »
Tbh, I did find that but I don't know how to implement that...

I am still a beginner and I don't know how to read the documentation.


10
Graphics / How Do I change background color of my window?
« on: September 05, 2017, 02:55:17 pm »
How Do I change background color of my window? It is by default back.

I searched for it in tutorials but I couldn't find...


11
Thanks I just moved
This line
[circle.setPosition(event.mouseMove.x, event.mouseMove.y);]

and it is working like a charm..

12
Thanks for the reply.

I read it carefully but I did not get how to implement it on my code..


13
when my cursor goes out of window my red circle goes to top left corner. Also when I click in the window the red circle goes to extreme left.

#include <SFML/Graphics.hpp>
#include<iostream>
using namespace std;
int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "Circle Cursor");
    sf::CircleShape circle(30);
    circle.setOrigin(30,30);
   
    circle.setFillColor(sf::Color::Red);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

        switch(event.type)
        {
        case sf::Event::EventType::MouseMoved:

         cout<<event.mouseMove.x <<" : "<<event.mouseMove.y<<endl;

        }
        }
        //if(sf::Event::)
        window.clear();
        circle.setPosition(event.mouseMove.x, event.mouseMove.y);
        window.draw(circle);
        window.display();
    }

    return 0;
}

14
Graphics / how to create a point in sfml?
« on: September 04, 2017, 03:52:37 pm »
how to create a point in sfml?

15
Graphics / Re: Why does my shape does not revolve around its center.
« on: September 02, 2017, 06:31:14 pm »
how does the set origin works?

if I have a circle of 100 unit radius then if I want to set its origin at center then i have written
entity.setOrigin(100,100); but what if I have a triangle and I need to set origin of the triangle ?

Pages: [1] 2
anything