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 - delio

Pages: 1 2 3 [4]
46
General / My vertex line is blinking
« on: March 09, 2014, 04:51:25 pm »
Here's my code

I want to create lines in every 40 px

cout << "enter width: ";
        cin >> x;
        cout << endl;
        cout << "enter height: ";
        cin >> y;

        sf::RenderWindow window(sf::VideoMode(x*4, y*4), "Window");
        /*sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);*/



        for (int i = 1; i <= x; ++i)
        {

                sf::Vertex outlinex[2] =
                {
                        sf::Vertex(sf::Vector2f(i * 40, 0), sf::Color::Blue),
                        sf::Vertex(sf::Vector2f(i * 40, 100), sf::Color::Blue)

                };
                window.draw(outlinex, 2, sf::Lines);
        }

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

                /*window.clear();*/
                /*window.draw(outlinex, 2, sf::Lines);*/
                window.display();
        }
       
        system("pause");

My problem is When I compiled, my lines is blinking
but when I delete for loop, it stop.

Thanks

47
General / Re: How can I make zoomable square table in SFML?
« on: March 08, 2014, 06:55:28 pm »
How can I create paint bucket tool and fill color in the tiles?
You could have a look at the flood-fill algorithm.

How can I split the square into tiles?
By using multiple tiles in its place, for example multiple sprites or shapes.

I think these things will become clearer as soon as you've experimenced a bit with SFML and maybe programming in general ;)

Thanks for your kindness  :)

48
General / Re: How can I make zoomable square table in SFML?
« on: March 08, 2014, 06:45:26 pm »
You can zoom using sf::View. The lines either appear automatically as they reach the necessary resolution, or you can colorize them explicitly depending on the current zoom level.

You should read the tutorials and documentation of SFML 2.1 to learn these concepts.

Thanks. I will read it

I have another question
How can I create paint bucket tool and fill color in the tiles?
How can I split the square into tiles?

Can you guide me ? I have no idea how can I make this


49
General / How can I make zoomable square table in SFML?
« on: March 08, 2014, 06:21:27 pm »
I have 2 questions.

1.How can I make zoomable square table like in the picture below?





At first, there is no line of tile in squares. but when zoom in, line of tiles are slowly appear inside squares.

I'm very newbie. So, Please guide me how to get started.



2.How I can create paint bucket tool and use to fill my tile then store information into array?


Thanks, Sorry for bad English

Pages: 1 2 3 [4]
anything