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

Pages: [1]
1
Graphics / Check string width in pixels
« on: November 29, 2009, 09:49:20 pm »
How do I know the string width in pixels?

2
Graphics / Image formats
« on: November 09, 2009, 04:39:22 pm »
What formats sf::Image support on LoadFromFile function?
It doesnt says in the documentation :(

3
SFML projects / My small shmup
« on: November 08, 2009, 09:30:43 pm »
Hello :D I'm working in my first game using SFML. Its a small shmup, we have to start small right?

Screenshot:


Source: http://www.4shared.com/file/149092192/4b5be5d2/Space_Game_source.html
Windows: http://www.4shared.com/file/149092034/5915c25a/Space_Game_Release.html

4
Graphics / One sprite, various objects, am I doing it wrong?
« on: November 08, 2009, 05:57:52 pm »
I am new to SFML and I'm making a small shmup. I have this image of a star(its actually a white dot but whatever). Then  Ive to draw each of the 1000 stars in the screen. But instead of using one sprite for each star I use sprite for every star! And I'm not sure if this is the right way :(
Code: [Select]

    for(int i = 0; i < (int)cg->stars.size(); i++)
    {
        switch(cg->stars[i].kind)
        {
            case 0:
            {
                cg->sprites[sid_star0].SetPosition(cg->stars[i].x, cg->stars[i].y);
                cg->sprites[sid_star0].SetRotation(cg->stars[i].rot);

                wnd.Draw(cg->sprites[sid_star0]);
            }
            case 1:
            {
                cg->sprites[sid_star1].SetPosition(cg->stars[i].x, cg->stars[i].y);
                cg->sprites[sid_star1].SetRotation(cg->stars[i].rot);

                wnd.Draw(cg->sprites[sid_star1]);
            }
        }
    }

5
Graphics / Font segfault D:
« on: November 08, 2009, 02:04:49 am »
Hello, I added this code to my game

Code: [Select]
void draw_hud(){
    sf::String score, hp;
    std::stringstream ss;

    score.SetFont(cg->hud_font);
    hp.SetFont(cg->hud_font);

    ss << (int)cg->player.score;
    score.SetText(ss.str().c_str());

    ss.str("");
    ss << "%" << cg->player.hp;
    hp.SetText(ss.str().c_str());

    score.SetPosition(24,480-48);
    wnd.Draw(score);

    hp.SetPosition(400, 480-48);
    wnd.Draw(hp);
}


And now a segfault happens when I close the game D:
Call stack:
#0 08FEAFDA   igldev32!devProcessAttach() (C:\WINDOWS\system32\igldev32.dll:??)

I already checked, its that code that makes segfault happen.

6
Graphics / Flipping a sprite horizontally/vertically
« on: November 07, 2009, 11:57:38 pm »
How do I flip a sprite horizontally/vertically? I tried SetScale(-1,-1) but nothing happens :(

Pages: [1]