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 - Sean Mulligan

Pages: [1] 2
1
SFML website / SFML Website Design
« on: June 07, 2023, 03:40:10 am »
Hello, The SFML website needs a graphical update. The aero style that rules the website isn't trustworthy in the present day because people associate it with viruses and phishing sites. If SFML got a graphical update then more people would use it because it would seem more appealing to those who want to create projects that are up-to-date with the current times. I do graphical design as a hobby, and I would be willing to help you, thanks.

2
Graphics / Re: Cannot Open File sfml-graphics-2-d.dll
« on: May 14, 2023, 09:18:35 pm »
Looks like it fixed the problems. In additional dependencies I put sfml-graphis-s-d.lib not sfml-graphics-2-d.dll, that was the mistake. Now I debugged to find that I completely screwed up how I was coding my GUI library before, so I learnt smart pointers to be able to work around inheritance issues, one step closer to completion :)

3
Graphics / Cannot Open File sfml-graphics-2-d.dll
« on: May 14, 2023, 06:49:35 am »
Hello, I am trying to link SFML dynamically for Visual Studio's debug mode. I downloaded the 32bit version of SFML 2.5.1 and am running with the correct version on Visual Studio. The dll file exists and is included in additional dependencies, and I have set everything up correctly following many tutorials to make sure that it was correct. Thanks for your help, and if this is Exploiter I would like to like to give you extra thanks for replying to all my petty questions.

4
Thanks bru, gonna setup my sfml debug mode properly now to do so, completely forgot that you could do that.

5
I am creating a personal SFML GUI library, but I have ran into an error, and I can't find any place online to fix it. In the main file, I am creating a panel and pushing buttons onto it. All the sizing is working correctly to be on screen and are out putted in the console. I am then drawing the panel which should be drawing the buttons, but that function is not activating. Please, how do I fix this?

main
int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "SFMin");

        sfm::Button button([]() {std::cout << "Hello World" << std::endl;}, "test");
        sfm::Button button2([]() {std::cout << "Hello World" << std::endl;}, "really really long name for testing purposes only");
        sfm::Panel panel(sfm::Layouts::LIST);
        panel.pushBackElement(button);
        panel.pushBackElement(button2);

        while (window.isOpen())
        {
                sfm::RegionCoordinates<sf::Vector2f> windowArea(sf::Vector2f(0.0f, 0.0f), sf::Vector2f(window.getSize().x, window.getSize().y));
                // ----------------polling----------------

                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                        {
                                window.close();
                        }
                        if (event.type == sf::Event::Resized)
                        {
                                sf::FloatRect visibleArea(0, 0, event.size.width, event.size.height);
                                window.setView(sf::View(visibleArea));
                                window.setSize(sf::Vector2u(event.size.width, event.size.height));
                        }
                }

                // ----------------update----------------

                panel.update(windowArea, &window);
                window.clear(sf::Color::White);

                // ----------------draw----------------

                panel.draw(windowArea, &window);
                window.display();
        }
        return 0;
}
 

Panel
void sfm::Panel::draw(sfm::RegionCoordinates<sf::Vector2f> drawingRegion, sf::RenderWindow* window)
{
        drawingRegion.correctCoordinates();
        float width = drawingRegion.endCoordinate.x - drawingRegion.startCoordinate.x;
        float height = drawingRegion.endCoordinate.y - drawingRegion.startCoordinate.y;
        //std::cout << "Width: " << width << "Height: " << height << "\n";
        float topPadding = (TOP_ELEMENT_PADDING * height) + (TOP_PANEL_PADDING * height);
        float bottomPadding = (BOTTOM_ELEMENT_PADDING * height) + (BOTTOM_PANEL_PADDING * height);
        float leftPadding = (LEFT_ELEMENT_PADDING * width) + (LEFT_PANEL_PADDING * width);
        float rightPadding = (RIGHT_ELEMENT_PADDING * width) + (RIGHT_PANEL_PADDING * width);

        float heightDivision = (height - topPadding - bottomPadding) / elements.size();
        float widthDivision = (width - leftPadding - rightPadding) / elements.size();
        this->elements.at(1).draw(drawingRegion, window);
        /*
        switch (this->layout)
        {
        case Layouts::LIST:
                break;
        case Layouts::ROW:
                break;
        }
        */

        for (unsigned int i = 0; i < this->elements.size(); i++)
        {
                sf::Vector2f startCoordinate(leftPadding, heightDivision * i + topPadding);
                sf::Vector2f endCoordinate(width - rightPadding, heightDivision * (i + 1) + topPadding);
                std::cout << "Start " << "X: " << startCoordinate.x << " Y: " << startCoordinate.y << "\n";
                std::cout << "End " << "X: " << endCoordinate.x << " Y: " << endCoordinate.y << "\n";

                RegionCoordinates<sf::Vector2f> elementRegion(startCoordinate, endCoordinate);
                this->elements.at(i).draw(elementRegion, window);
        }
}
 

Button
void sfm::Button::draw(sfm::RegionCoordinates<sf::Vector2f> drawingRegion, sf::RenderWindow* window)
{
        std::cout << "Hello World" << std::endl;
        drawingRegion.correctCoordinates();

        // ----------------background----------------

        sf::RectangleShape background;
        background.setPosition(drawingRegion.startCoordinate.x, drawingRegion.startCoordinate.y);
       
        // sizing
        float width = drawingRegion.endCoordinate.x - drawingRegion.startCoordinate.x;
        float height = drawingRegion.endCoordinate.y - drawingRegion.startCoordinate.y;
        background.setSize(sf::Vector2f(width, height));
       
        // styling
        if (hover)
        {
                background.setFillColor(ELEMENT_COLOR_HOVER);
        }
        else
        {
                background.setFillColor(ELEMENT_COLOR_NORMAL);
        }
        background.setOutlineColor(OUTLINE_COLOR);
        background.setOutlineThickness(OUTLINE_THICKNESS);

        window->draw(background);

        // ----------------text----------------

        if (this->textDescription.length() > 0)
        {
                sf::Text text;
                text.setPosition(drawingRegion.startCoordinate.x, drawingRegion.startCoordinate.y);
                text.setString(this->textDescription);

                // styling
                text.setFillColor(TEXT_COLOR);
                text.setFont(this->font);

                // sizing
                sf::FloatRect rectangle = text.getLocalBounds();
                float ratio = width / rectangle.width;
                text.setCharacterSize(unsigned int((float)text.getCharacterSize() * ratio));
               
                rectangle = text.getLocalBounds();
                ratio = width / rectangle.width;
                text.setScale(ratio, ratio);

                window->draw(text);
        }

        // test drawing
        sf::RectangleShape shape;
        shape.setPosition(0, 0);
        shape.setSize(sf::Vector2f(100, 100));
        shape.setFillColor(sf::Color::Cyan);
        window->draw(shape);
}
 

6
SFML projects / Re: [PC & Mobile] GravytX The Gravytoid
« on: May 11, 2023, 09:27:07 pm »
Looks great! hope to make a complete project one of these days.

7
SFML projects / Re: Axioms Of Dominion, An Empire Forging Game
« on: December 09, 2022, 10:54:25 pm »
Hey, did you get my offer through messages, anyway I will post it here as well. I make pixel art, and I am looking to expand my skills, so I will be so happy if you let me make some art for your game. Thanks for your consideration. ;)

8
SFML projects / Re: [Android - HTML5] I Can Transform : All Stars Racing
« on: December 09, 2022, 10:40:43 pm »
Wow, looks great, I am always impressed by these kinds of projects, and the amount of ports shows some technical skill. How long did this all take?

9
Graphics / Re: Texture is not rendered
« on: December 01, 2022, 09:44:54 pm »
Hey, you forgot your "C:" at the beginning of the file path. You're on Windows right?

If you don't want a full file path look here:
https://en.sfml-dev.org/forums/index.php?topic=7701.0

10
General / Re: Type casting in c++
« on: November 30, 2022, 03:22:31 am »
Hey, thank you for replying. Your in-depth explanation of cating in sfml will really help me in future projects.

11
General / Type casting in c++
« on: November 28, 2022, 08:45:46 pm »
Thanks for your help. I have been coding in c++ for about a year, but I am unsure on more complex subjects.

12
Hey, I was debugging my code, and there was nothing wrong with SFML. Turns out I had an issue with signed/unsigned ints messing with the negative values when drawing.

Thank you nonetheless Stauricus for your help. ;) This may be one of the kindest sites on the internet.

----------------------------------ANSWER FOR ANYONE WITH THIS PROBLEM----------------------------------

Please check if your variables are signed and unsigned. This was the cause of the problem for me.
----------------------------------------------------------------------------------------------------------------------

13
Yes, the sprite is being rendered from a point outside the view to inside the view, so the sprite should be partially seen, but is not rendering at all. I could provide some demo code if you would like.

14
SFML projects / Re: Screenshot Thread
« on: November 28, 2022, 04:14:34 am »
A simple moving dots simulation.


15
SFML projects / Re: At Odds - Space RTS
« on: November 28, 2022, 03:04:18 am »
Wow, this game looks great. How long have you been developing in sfml for? You have any tips on structuring the code in a game? Graphics could use an overhaul, but art is really hard to get right. Great job!  ;)

Pages: [1] 2
anything