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.


Topics - ILostMyAccount

Pages: [1]
1
DotNet / How easy is it gonna be to port my engine in .net?
« on: November 01, 2015, 10:58:10 am »
Do you think is going to be difficult porting my C++/SFML engine to C#/SFML?

2
Graphics / Sprite bounds problem?
« on: February 20, 2015, 01:04:18 pm »
I'm trying to make a button, everything is working fine, except for one thing.
If I try to move or scale the button the bounds don't change, and obviously the mouseclick still gets detected at the initial position.

This is my button update code:
                mCDTime = mCDClock.getElapsedTime();
                if (mEnabled && mCDTime > sf::Time(sf::seconds(0.30f)))
                {
                        auto spriteBounds = mSprite.getLocalBounds();
                        auto mousePosition = sf::Mouse::getPosition(*mWindowPtr);
                        if (spriteBounds.contains(static_cast<sf::Vector2f>(mousePosition)) && sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
                        {
                                OnClick();
                                mCDClock.restart();
                        }
                        mText.setPosition(mSprite.getPosition());
                        mText.setScale(mSprite.getScale());
                        mText.setRotation(mSprite.getRotation());
                }

3
Graphics / Sprite batching?
« on: February 17, 2015, 11:11:58 am »
Can someone explain me what exactly is the sprite batching?
And can you link me an example of code in SFML?

Thank you.

4
Graphics / Is this correct?
« on: February 06, 2015, 01:20:05 pm »
As the title says, is this correct?

5
General / SFML + Box2D?
« on: January 29, 2015, 01:18:27 pm »
Hi, I don't know if posting this is against the rules but I've learned a decent part of SFML now, and since I wouldn't even be able to create a decent physic/collision system Box2D should be able to help me, though I have no idea where to start, can you link me a good guide to use SFML + Box2D?

6
General / Is this going to cause performance issues?
« on: January 28, 2015, 11:12:58 am »
I'm loading the textures like this:
        sf::Texture texture[16];
        int count = 0;
        for (int line = 0; line <= 64; line += 64)
        {
                for (int column = 0; column < 512; column += 64)
                {
                         texture[count].loadFromFile("Resources/Sprites/SpriteSheet.png",sf::IntRect(column,line,64,64));
                         count++;
                }
        }
Am I going to take any advantage from the fact that they are on the same image file? Or is this just going to make things worse?

7
Network / TCP fail to send data
« on: January 21, 2015, 03:16:14 pm »
What's wrong with this? :
        while (!done)
        {
                std::cout << "Creating connection" << std::endl;
                sf::TcpSocket socket;
                sf::Socket::Status status = socket.connect("192.168.0.5", 53000);
                if (status != sf::Socket::Done)
                {
                        std::cout << "Client Error" << std::endl;
                }
                std::cout << "Created" << std::endl;
                char data[100] = { 'H', 'e', 'l', 'l', 'o', '\0' };
                system("pause");
                if (socket.send(data, 100) != sf::Socket::Done)
                {
                        std::cout << "Client Error : Couldn't send data" << std::endl;
                }
        }

Basically it sends the data the first time, then fail the second, and work the third, and fail the fourth and... you get what I mean...

How do I fix it?

(Ignore the "system("pause")" it's just to test and it's faster than typing something everytime.

8
General / How should the code be organized?
« on: December 22, 2014, 02:33:43 pm »
I know that there are lots of ways but what do you do usually?
What's inside your main? Where do you initialize your sprites?
I've always used engines so I didn't really have to worry about it too much but now...


9
General / What's wrong with this? (white sprites)
« on: December 19, 2014, 03:49:09 pm »
So, I wrote this:


The problem is that when I use it it draws white textures instead of the one that i've used  :-[

Pages: [1]
anything