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

Pages: [1]
1
Window / sfml-window startup
« on: March 31, 2011, 08:00:36 pm »
Ugh, I worked with SFML for such a long time now, and recently I updated my ATI driver for no reason at all. All of a sudden none of the windows render anymore and it confused me so much (even more so when everything else works, like sound). Took me so long to figure out it was because of the driver UPdate.

So what should we do now? Is waiting the only thing we can do? I use the SFML 1.6 right now, does the 2.0 version out right now support the new ATI drivers? Or maybe I should somehow revert back to the old drivers so I can at least work again?

2
General / Main Menu in SFML need tips
« on: September 28, 2010, 06:23:48 pm »
I've been working on the same thing pretty much. At first I did background image, then text as buttons. Later, I realized the font I used looks really bad when it was used under the SFML font stuff, so I ended up putting them through photoshop and exporting png images (that way I can put shadows behind the text to make them look good as well.

Once all that's done, I use a background image, then display the buttons (texts) on top of it, with the shadows and all, it looks really great. Really simple and looks the best out of all 3 of your choices IMO.

Here's a screenshot of the final version of the menu I did.


3
General / Beginner Code Problems
« on: September 25, 2010, 03:37:34 am »
Hey again, this time I really came across something I can't figure out.

I wrote a text display function so that the text will have a type writer effect (1 letter displayed at a time until the whole string is displayed).

Code: [Select]
void writer (string s, int xpos, int ypos) //s is the whole string planned to be displayed, xpos and ypos are the position coordinates of the string.
{
    vector<char> vechars; //vector to store the letters from the string one by one.
    string text(s.size(), ' '); //a second string to be put into sf::String with the portion of the original string taken from the vector to be displayed.

    for (int i = 0; i <= s.size(); ++i)
    {
        vechars.push_back(s[i]); //put a letter from s to the vector
        for (int j = 0; j <= vechars.size(); ++j)
        {
            text[i] = vechars[i]; // map all the chars from the vector to the new string.
        }
        sf::String temptext(text, MyFont, 25);// put the new string into SFML to be displayed.
        temptext.Move(xpos, ypos);
        App.Draw(temptext);
        for (int w = 0; w < 10; ++w)
        {
            App.Display(); // display it for 10 frames per letter so the effect lasts longer.
        }
    }
}


Supposedly, this code should work, and it does, everything does run. however, when the letters are being displayed one by one, the entire string is constantly very jittery and flickers a lot. At first I assumed that this was before I did not do App.Clear(); before every frame, but then I realized I can't really do it because then I would have to pass EVERYTHING (background images, other images, etc) to the function to even get it to run.

Taking out the for loop for the 20 frame per letter display makes it not jittery anymore, but the font looks a lot fatter than it should, making it impossible to be read. I assume this is a problem with not properly clearing the screen every time app.display is called, but I don't really know how I can clear the screen if there's already background images which can't really be passed into the function.

4
General / Beginner Code Problems
« on: September 24, 2010, 10:51:42 pm »
Hi everyone, I have another very beginner question.

I've been trying to write some functions involving sf::RenderWindow and sf::Event. For example, I try to write a void function to do repetitive display work (like playing some cutscenes, etc), but I'm trying to make it so if the player presses esc, then the cutscene would skip or bring up menus or something.

So, this means I need this section from the tutorials
Code: [Select]

        while (App.GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();
            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();
        }


But the problem is if I try to pass sf::RenderWindow into the function, it gives me odd errors which involve sfml's own files. I'm obviously doing something wrong here, is there some way around this/a better way to do it?


EDIT:
Another example, a typewriter function I just wrote. I plan to implement this graphical thing into the program, but the App.Display(); and App.Draw(Text); things require the sf::RenderWindow to be passed? into the function?

(Not yet configured into SFML form due to conflict with the renderwindow thing.
Code: [Select]
void typewriter(string s)
{
    for(int i = 0; i < s.size(); ++i)
    {
        for (int j = 0; j < i; ++j)
            cout << s[j];
        cout << s[i];
    }
}

It feels almost as if Ninjastrum has the same problem I do.


EDIT: that was very dumb of me. A friend pointed out that I could've just used global variables to define App, which I totally forgot I can do. Problem completely solved.

5
SFML projects / simple Visual Novel "engine"
« on: September 24, 2010, 09:50:37 pm »
Wow that's really nice! I've been working on making a videogame which is very text intensive. Something like this would be very beneficial to something like that.

The file says it's unavailable at the time though, might be a megaupload server problem?

6
General / Beginner Code Problems
« on: September 22, 2010, 10:44:55 pm »
I see, I understand now.

App.Display() is when the frame is displayed. Everything that happens before then is just setting up the frame/scene for it to be displayed.

In the loop, App.Display() occurs once every iteration, meaning that every loop would be a "frame." So, if I want a particular frame to loop a certain way, all I need to do is do App.Display(), of course, with setup beforehand.

Thanks so much for all this, it was very helpful and I'll be on my way to continue the program.

7
General / Beginner Code Problems
« on: September 22, 2010, 09:52:31 pm »
Oh I see, I didn't know that. Thanks so much!

I managed to get it work by putting a for loop right after the while App.IsOpened got declared, and ended it after App.Display.

However, this seems really inconvenient and unwieldy, especially if the program is designed to have fade in text, then fade out, then fade in another line of text, etc. Is there maybe a better way to do this? Maybe I can build some kind of function where you give it the string of text and the location of where you want the text displayed and have some kind of fading effect built into that function?

Sorry for being a total noob.

8
General / Beginner Code Problems
« on: September 22, 2010, 09:26:07 pm »
Quote from: "Beliar"
What i would do is have a variable for the alpha value, change that each frame


Hmm, do you know how I can do that? I'm not too clear on how frames work and I haven't found any tutorials/guides as to practicing working with them.

9
General / Beginner Code Problems
« on: September 22, 2010, 08:58:30 pm »
Hi, I'm new to SFML and new to programming in general. I have started self learning C++ a few days ago as well as SFML. I have read through and did most of the beginner tutorials on this website.

I've been trying to test out how to display something which has the ability to fade in and fade out and such. I tried several things, including the following code which I thought was going to work:
Code: [Select]

while (true)
{
    for (int j = 0; j <255 ; ++j)
    {
        Sprite.SetColor(sf::Color(255, 255, 255, j));
        App.Draw(Sprite);
    }
    for (int k = 255; k !=0 ; --k)
    {
        Sprite.SetColor(sf::Color(255, 255, 255, k));
        App.Draw(Sprite);
    }
}


But, it doesn't. I assume I'm using the Draw() function completely wrong. I read through the documentations about it but it's really hard to make sense of how that all works as a beginner.

Any help would be appreciated. If I'm just dumb and you don't feel like answering, if there's any resources that I can read, feel free to link it so I can learn. Thanks in advance!

10
SFML projects / Excellence (previously Eve Shooter)
« on: September 21, 2010, 05:03:08 pm »
Thank you so much for this. It's been bugging me for such a long time, finally got this question answered.

Anyways, I won't distract this topic anymore. Back onto the topic of the excellent shooter game.

In terms of gameplay suggestion, I think it would be great if you take a direction between bullet hell shooter, or action shooter. Bullet hell shooter can be designed to be a slower pace but it would require you to at least be able to see your own hitbox, whereas action shooter's hit box isn't as necessary, but the bullet speed is generally a lot faster and it would be more reaction based. Of course you can take the direction of both of them and it would, IMO, make a very fine game.

Also, if you plan some kind of level editor on release, that would be really fun too, give the players a chance to design their own shooter levels.

In terms of graphics suggestion, I think a great game that you can check out for some crazy graphic inspiration is Beat Hazard. This game reminded me a lot of it and I personally think this is better is a lot of ways, but beat hazard is a very interesting game where the music (which seems like a important factor in this game) is directly tied into the gameplay. I think it does a lot of things wrong, but it's great inspiration nonetheless.

Keep it up and I'm definitely interested in seeing the progress to the final product!

11
SFML projects / Excellence (previously Eve Shooter)
« on: September 21, 2010, 12:59:24 am »
Really excellent start, it looks so professional. The graphics are beautiful as well. It actually reminds me a lot of the Touhou games, especially your choice of bullet graphics and pattern, very interesting and fun.


I have a small question though, I know this may not be the perfect place to ask this, but it's been bothering me. How did you compile the game so that the resources are encrypted in a special file format and all? I'm a beginner programmer so I'm not totally familiar with these things.

Thanks in advance!

12
General / Problem installing
« on: September 20, 2010, 10:42:07 pm »
I'm having this same problem. Been using code::blocks for a while now, just starting SFML.

At first when I tried to create a SFML file under the templates, it opened up this scripted GUI where I had to look for a bunch of things. Without knowing what it was, I located the default SFML folder which was in C: at the time, and moved on. Later to find out that there's an error somewhere so I closed it.

Now when it prompts me to look for SFML's base folder, the GUI based thing doesn't open anymore. I would put the SFML-1.6 folder under C: as the base folder, but it would have the same exact prompt as the original poster's prompt.

Any help would be appreciated. Thank you.


EDIT: I managed to get past that part by moving all the files in the .../include/SFML folder into .../include instead, but there's an error message saying "cannot find -lsfml-audio.dll" in file ld.exe


EDIT #2: I finally managed to get SFML working. It seems like maybe SFML had a new version of file organization where Code::Block's current version doesn't recognize it. I had to use the console application template to follow the SFML tutorial instead. Some of my other problems included weird errors and such, EDIT 1's problem was fixed when I realized I forgot to link the include and lib folders into code blocks through the "Search directories," and the 2nd problem which I didn't state was the error of forgetting -lsfml-system in my other linker options.

Pages: [1]