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

Pages: [1]
1
General / Main menu buttons
« on: February 09, 2013, 01:42:53 pm »
How exactly would I code a function that checks to see if the mouse is in a certain area, and then when it's clicked another function will start. SO basically, how can I make an invisible box around a sprite that checks to see if the mouse is in it?

I can't seem to find anything on google.

This is with SFML 2.0 by the way.

Thanks in advance :)

2
General / Re: Two screens, but the same window
« on: January 30, 2013, 09:53:08 pm »

One often refers to it as state manager. Google will already tell you quite a lot about it and if you want to see an example, my SmallGameEngine could be one. :)


Thanks, that was my main problem. I had no idea what that sort of a thing would be called, it's hard to google things if you don't have a clue what it is you're supposed to google.

But when I said, I know a fair bit of everything, I didn't really mean that. I know how to use the basics (classes, functions, vectors etc etc..), and I can make simple-ish programs.
But you can never stop learning C++ (well you can, but you know what I mean) :b

Thanks for your help :)

3
General / Re: Two screens, but the same window
« on: January 30, 2013, 09:32:08 pm »
Forgot to mention, I'm using SFML 2.0

4
General / Two screens, but the same window
« on: January 30, 2013, 09:31:30 pm »
Hi,

The title makes very little sense but I couldn't think of any other way to describe my problem. I was doing a fair bit of C++ and I know pretty much the basics of most things (except pointers, those things are just so confusing for me), and I decided that I wanted to start doing graphical things. And SFML was right for me

Any way, I've been writing my game for about 3 or 4 days on and off, and I've run into several problems. I'm making functions, eg. my mainmenu() and game() functions. And they both include the header which is the window creation  (the sf::RenderWindow class). And what I want ideally to happen, is when you launch the .exe the main menu will appear, then if you click the start button it'll take you to the game. Without having to close the exe and launch another one.

I'm pretty sure this is possible but you never know.

SO in summary, my two problems are: How do I get two different functions that use the same window but in order. As I said earlier, you launch the game and then main menu comes up, click a button then bada bing badaboom you're playing the game.
And my seconds problem is how do I make a button (how ever, only answer this if you can be bothered, I'm pretty sure there are answers for this, but I haven't done much searching).

My Window.h
Code: [Select]

sf::RenderWindow window(sf::VideoMode(1920,1080),"Alpha");



And then I have the two functions that use that. And should I post the code for them or not? For my problem in question I don't think I need to but if it would help you understand what I'm blabbering on about then I will.

Both of my two functions
Code: [Select]
int mainmenu() and int game() use the Window.h include file so that they both use the same window, and they also both have a
Code: [Select]
while (window.isOpen()) in them.
I think that's my problem.


Any way, any help would be much appreciated and just ask if you need any more information :)

Pages: [1]