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

Pages: [1] 2
1
Graphics / Re: [Solved] Fade effect
« on: August 02, 2015, 07:41:54 pm »
Thanks for the input guys.
Havent't tried Thor out yet, will check it out sometime.

2
Graphics / Re: Fade effect
« on: July 30, 2015, 01:03:29 pm »
Yes, the fade is on the top of everything else (drawn last).
EDIT: Tried the classless version again, it does work actually, didn't notice because I didn't wait enough I guess, so it did work. Something with my class did not though, I'll figure that out. Thanks for the help.

3
Graphics / Re: Fade effect
« on: July 30, 2015, 12:58:23 pm »
What is "other stuff"? If it's window.clear(), that's good. However, nothing suggests that you're using window.display() after that draw.

My bad. Yeah, clear, display is there, along with other stuff being drawn, so it should be noticeable.

4
Graphics / [Solved] Fade effect
« on: July 30, 2015, 12:43:37 pm »
Been trying to create a fading effect, made a separate class for it, everything works fine, except not really. The basic idea was to draw a RectangleShape across the whole screen with a black fillcolor, and an alpha of 0, then the class gradually increases it over a period of time. When I run the thing, that period of time is noticeable, so the class does what it is supposed to do, except I don't see the rectangleshape at all, even though it is being drawn, it is transparent during the whole thing. Tried to do it just within the loop as well, without the class, the issue is the same.

Without class version:
        Clock clock;
        RectangleShape fade;
        fade.setPosition(Vector2f(0,0));
        fade.setFillColor(Color(0,0,0,0));
        fade.setSize(Vector2f(800,600));
        int i=0;
    while (window.isOpen())
    {
        if(clock.getElapsedTime()>seconds(0.04)){
            i++;
            fade.setFillColor(Color(0,0,0,i));
            clock.restart();
        }
     ///other stuff
        window.draw(fade);
     }
 

Am I just not supposed to be doing this with a RectangleShape?

5
Graphics / Re: Custom icon for renderwindow
« on: July 17, 2015, 06:50:44 pm »
.png it is then. Case solved I guess. Thanks.

6
Graphics / Re: Custom icon for renderwindow
« on: July 17, 2015, 06:09:10 pm »
According to that, it should be something like this:
window.setIcon(image.getSize().x, image.getSize().y, image.getPixelsPtr());
Compiled fine, but the icon didn't change. Problems with the image format maybe? Using a 128x128 .ico.

7
Graphics / [Solved] Custom icon for renderwindow
« on: July 17, 2015, 05:51:05 pm »
window.setIcon(image.GetWidth(), image.GetHeight(), image.GetPixelsPtr());

Tried using this, but it's telling me the methods aren't within Image as members. Is this an outdated way of doing it, or am I doing it wrong? Using SFML 2.2.

8
Window / Re: Making key pressed event fire only once
« on: July 17, 2015, 08:40:33 am »
Which OS?

Windows 7.

If you are using sf::Keyboard::isKeyPressed(), it will always be continuous. window.setKeyRepeatEnabled() only effects events.

Oh I see. Yeah, I used that. Thanks for the help.

9
Window / [Solved] Making key pressed event fire only once
« on: July 16, 2015, 07:18:51 pm »
Did some search about this, found a solution, which is to use this: window.setKeyRepeatEnabled(false);
But it does not seem to be working, the event is still firing continuously. Is this no longer functional? My SFML version is 2.2.

10
Graphics / Re: Failed to create texture, internal size too big
« on: February 20, 2015, 01:04:28 pm »
Case solved. Looks like the code was wrong in the first place, even though it compiled. Creating it as a sprite worked, and it displays the image without issues.

Code: [Select]
    sf::Texture texture;
    texture.loadFromFile("texture.jpg");
    sf::Sprite sprite;
    sprite.setTexture(texture);
    sprite.setTextureRect(sf::IntRect(0, 0, 32, 32));
    sprite.setPosition(100, 25);
    window.draw(sprite);

Thanks for the help, guys.

11
Graphics / Re: Failed to create texture, internal size too big
« on: February 20, 2015, 12:29:35 pm »
Quote
Can't tell you about the examples as of now, since it looks like CodeBlocks forgot the library linking settings, so I have to redo the whole thing.
The precompiled examples are provided in the SDK. You just have to run them.

I know. I just had to redo the library linking, which I did now. Used normal instead of static this time, all examples run fine except ftp, sockets, and voip. And shader also compiles but then freezes at the start, I assume that's not what it was meant to do.

12
Graphics / Re: AW: Failed to create texture, internal size too big
« on: February 20, 2015, 11:49:37 am »
OS? GPU? SFML version? Compiler?

Can you run any of the SFML examples?

Windows 7
ATI card
SFML 2.2
CodeBlocks - GNU/GCC Compiler

Can't tell you about the examples as of now, since it looks like CodeBlocks forgot the library linking settings, so I have to redo the whole thing.

13
Graphics / Re: Failed to create texture, internal size too big
« on: February 19, 2015, 10:01:40 pm »
Quote
And on a sidenote, the program thinks the image is 4294967228x4294967228 pixels big.
Programs don't think. So where did you get these values from?

From the debug console.

14
Graphics / Re: Failed to create texture, internal size too big
« on: February 19, 2015, 08:30:44 pm »
I did try, gives the same error, except the number it says is different.

15
Graphics / Re: Failed to create texture, internal size too big
« on: February 19, 2015, 06:29:58 pm »
Yeah.
And on a sidenote, the program thinks the image is 4294967228x4294967228 pixels big.

Pages: [1] 2
anything