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

Pages: [1]
1
General / Re: Trouble using Mouse::GetPosition() relative to the screen
« on: October 24, 2013, 12:09:28 am »
You're right, i don't know why I didn't think of this...just stuck in a complete mind blank -_-

2
General / Trouble using Mouse::GetPosition() relative to the screen
« on: October 23, 2013, 11:58:20 pm »
I'm trying to use pass by reference so I can get my mouse X and Y coordinates relative to the screen inside another class but I am having trouble doing so

what i have is
void MenuNav(sf::RenderWindow*) //in h file

//in the cpp i have
void HUD::MenuNav(sf::RenderWindow *Window)
{
      sf::Mouse::getPosition(Window).x;
}

but it seems to have a problem with that.
Error:no instance of overloaded function, I know that the problem is Window in the getPosition function but i cant figure out what is meant to go there.

3
Window / Cannot move 2nd window when created
« on: September 12, 2013, 03:29:53 am »
I'm having a problem where I open up my game, the screen opens and when I hit exit a 2nd window opens asking if you're sure.
When this window spawns I cannot click and drag the box or click close when the box spawns on top of the 1st window.

Meaning if I spawn the 2nd window, click back to the 1st then drag it out of the way I can now click and move the window.

Also I've assigned a keypress so if you hit Return while this 2nd window is open it will close everything, this does work perfectly fine, the only problem is clicking and dragging the actual box.

The way I do it is...

                while (Game.pollEvent(Event))
                {
                        if ((Event.type == sf::Event::Closed) || (sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt) && sf::Keyboard::isKeyPressed( sf::Keyboard::F4)) || (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)))
                        {
                                CreateExit(sf::VideoMode(300,100), sf::String("Exit?"));
                        }
                }

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

                                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Return))
                                {
                                        Game.close();
                                        ExitScreen.close();
                                }
                        }
                }

Pages: [1]