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

Pages: 1 2 [3] 4 5 6
31
General / SFML Window not showing!!!
« on: January 02, 2012, 01:36:02 am »
Ive already tried that website...

32
General / SFML Window not showing!!!
« on: January 01, 2012, 07:35:08 pm »
Okay..Does anyone know of a site that has actually good sfml tutorials? Ive searched soooo much and all of the sites explain NOTHING.. I sort of know the basics but i still want to learn more about the sf namespace and such..and dont say documentation because its not like that explains it well.

33
General / Distributing SFML games on other websites.
« on: January 01, 2012, 01:28:37 am »
What i meant that the players would know i made it in sfml is that since the dlls are named sfml-whatever, they would know its sfml and then what if they also programmed games in sfml too? So then they would know..

34
General / Distributing SFML games on other websites.
« on: December 29, 2011, 10:57:04 pm »
So how do you distribute games over the web that you make in SFML? And do the SFML dlls have to go with the package because then people would know i made it in SFML which would mean they could modify it by some way.. and also the dlls take up alot of more memory and then the game itself with the assets all take up a lot of mb just for a flash game.. And could i earn money by advertising in my game? Im a noob in this kind of stuff..

35
General / SFML Window not showing!!!
« on: December 29, 2011, 05:10:34 pm »
@Pyrius   Lol sorry shoulda looked at your advice more carefully :D   But thanks! Any ideas on how to make my OWN spritesheet?

36
General / SFML Window not showing!!!
« on: December 29, 2011, 05:10:29 am »
YES i FINALLY GOT IT NO FLICKERING A PERFECT ANIMATION! The problem was that i was actually drawing a subrect that was out of bounds of the spritesheet which meant it came up blank. Heres the updated code:

Code: [Select]

#include <SFML/Graphics.hpp>



int main()
{
    sf::RenderWindow Window(sf::VideoMode(800,600,32), "asdsad");

    sf::Clock clock;

    sf::Texture pic;
    sf::Sprite sprite;
    int frame,frame2;
    frame = 0;
    frame2 = 0;

    pic.LoadFromFile("SpriteSheet.png");

    sprite.SetTexture(pic);

    while(Window.IsOpened())
    {
        sf::Event Event;

        while(Window.PollEvent(Event))
        {
            if(sf::Keyboard::IsKeyPressed(sf::Keyboard::Escape))
            {
                Window.Close();
            }


        }

            Window.Clear(sf::Color::Cyan);

            if(clock.GetElapsedTime() >= 100)
            {

                sprite.SetSubRect(sf::IntRect(frame * 128,frame2 * 128,128,128));

                ++frame;

                if(frame == 4)
                {
                    frame = 0;
                    ++frame2;
                }

                if(frame2 == 4)
                {

                    frame2 = 0;
                }

                clock.Reset();

            }





            Window.Draw(sprite);

            Window.Display();








    }


    return 0;
}



So you see i put frame == 4 and frame2 == 4 instead of frame and frame2 == 5. So now i was drawing the frames in the actual sprite sheet, not a subrect beyond it. :D Thanks for all advice i extremely appreciate it!

37
General / SFML Window not showing!!!
« on: December 28, 2011, 04:47:59 pm »
Still flickering..

38
General / SFML Window not showing!!!
« on: December 27, 2011, 11:14:00 pm »
its "* 128"  because remember i said i tried a new one and the black isnt there anymore but the animation still flickers? Well this one is bigger size so thats why. And i put " frame2 %= 5" and the animation messed up and the flickering was still there. And "frame2 == 5" is basically the same as "frame2 > 4" so.. Maybe it has to do with framerate or something?

39
General / SFML Window not showing!!!
« on: December 27, 2011, 10:37:53 pm »
Code: [Select]


if(clock.GetElapsedTime() >= 100)
        {
            sprite.SetSubRect(sf::IntRect(frame * 128,frame2 *    128,128,128));
            ++frame;

            if(frame > 4)
            {
                frame = 0;
                ++frame2;

            }
            if(frame2 > 4)
            {
                frame2 = 0;
            }
            clock.Reset();


        }



This is my new code. I just changed the subrect parameters so now frame2 * 128 . Is there anything else i need to change?

40
General / SFML Window not showing!!!
« on: December 27, 2011, 09:28:12 pm »
Wow. The animation just got so much better. It wasnt even properly walking lol now it is. However, it didnt solve the black flickering problem. So maybe i thought it was the spritesheet. But when i tried another one, there was no black but it was still flickering..

41
General / SFML Window not showing!!!
« on: December 27, 2011, 09:06:56 pm »
Without the subrect function, it simply shows the whole spritesheet, no flickering of black thing. The flickering only happens when its animated(using subrect).

Heres my whole program code:
Code: [Select]



#include <SFML/Graphics.hpp>



int main()
{

    sf::VideoMode vmode(800,600,32);
    sf::RenderWindow Window(vmode, "Animation Training");


    sf::Texture texture;
    texture.LoadFromFile("Walker.png");
    sf::Sprite sprite;
    sprite.SetTexture(texture);
    int frame = 0;
    int frame2 = 0;
    sf::Clock clock;



    while(Window.IsOpened())
    {
        sf::Event Event;

        while(Window.PollEvent(Event))
        {
            if(Event.Type == sf::Event::Closed || sf::Keyboard::IsKeyPressed(sf::Keyboard::Escape))
            {
                Window.Close();
            }
        }

        Window.Clear(sf::Color::Cyan);

        if(clock.GetElapsedTime() >= 100)
        {
            sprite.SetSubRect(sf::IntRect(frame * 68,frame2,68,68));
            ++frame;

            if(frame > 5)
            {
                frame = 0;
                ++frame2;

            }
            if(frame2 > 5)
            {
                frame2 = 0;
            }
            clock.Reset();


        }


        Window.Draw(sprite);


        Window.Display();






    }





    return 0;
}


Oh yes and btw the whole sprite sheet is 340 by 340(in pixels).  And theres 5 columns and 5 rows of images(frames) in the sprite sheet. And frame2 is for when the subrect "moves" to the next row so i increment it by 1 when frame is greater then five and then when frame2 reaches the last frame in the last row and frame also reaches the last image in the last row, they both reset to 0 which restarts the animation process.

42
General / SFML Window not showing!!!
« on: December 27, 2011, 07:18:31 pm »
Yep i use sf::Texture and sf::SetTexture too. So whatès my problem with the image flickering to black and then normal and then black...?

43
General / SFML Window not showing!!!
« on: December 27, 2011, 05:21:51 am »
Nope. I'm using SFML 2.0 because i use sf:PollEvent and it works. Also, I use another function thats in SFML 2.0. So i use SFML 2.0...

44
General / SFML Window not showing!!!
« on: December 25, 2011, 10:10:45 pm »
I can't see sf::SetSmooth in sfml 2.0 .  And if its default, then whyre you telling me to set it to false if its already there? Im confused..

45
General / SFML Window not showing!!!
« on: December 25, 2011, 08:55:57 pm »
Quote from: "Anata"
Smooth to false for this



What...?

Pages: 1 2 [3] 4 5 6
anything