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

Pages: [1]
1
Graphics / animated images in sfml
« on: March 12, 2010, 02:30:21 am »
I was wondering if its possible to just have images like gifs, and such in sfml. Where they are animated themselves.

2
Graphics / Program won't load images
« on: March 10, 2010, 09:37:45 pm »
well i tried setting it to transparent, and well i wasnt good at doing that. So i just ended up deleting the background of the sprite. Well it works for the most part but not there is lines coming out from the sprite. If someone could possibly look at the sprite and see maybe why its happening.

Nvm, it was just the images. Well now i have it working, i just need to do diagonal movements which im guessing you just do when buttons pressed equal this and this.

3
Graphics / Program won't load images
« on: March 10, 2010, 03:37:34 am »
Yea i found that out while looking through the wiki after posting it xD .
Well now i just got to get rid of the white background, which im trying to do with png's like you said. Then i need to add i think a 50 millisecond delay to make it transition smoothly to the next set image.

Edit:
So how do i set the alpha transparency?

4
Graphics / Program won't load images
« on: March 10, 2010, 02:30:51 am »
Ok
Keypress up:
Code: [Select]


void mdown()
        {
            if (dcount == 7)
                dcount = 0;
            else
                dcount += 1;

            ucount = 0;
            lcount = 0;
            rcount = 0;
        }

--------------------------------------------------------

if (App.GetInput().IsKeyDown(sf::Key::Down))
        {
            avatar.mdown();
            Sprite = avatar.dimage[avatar.dcount];
            Sprite.Move(0,  100 * ElapsedTime);
        }


I used the dashes to separate them because they are at 2 different parts.
I run the mdown function to change the count. Set the image to the new image.

5
Graphics / Program won't load images
« on: March 10, 2010, 02:07:58 am »
Ahh, well thank you. I was wondering why there was a white background for my files. Ohh and now i have a new problem. If i hit the down key, which is the only one coded for the change in the sprite. It just moves the sprite to the top left corner.

6
Graphics / Program won't load images
« on: March 10, 2010, 12:29:01 am »
Ok so i found out that my images are broken according to SFML only though. So i have to see whats wrong with them.

7
Graphics / Program won't load images
« on: March 09, 2010, 10:19:58 pm »
The only thing im thinking, is that i get this warning from the compiler. But i don't see how it could be the problem because i did a program with a single image and that worked fine.

||Info: resolving vtable for sf::Spriteby linking to __imp___ZTVN2sf6SpriteE |
||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||=== Build finished: 0 errors, 1 warnings ===|

8
Graphics / Program won't load images
« on: March 09, 2010, 09:40:37 pm »
Code: [Select]

for (dcount = 0; dcount < 8; dcount++)
            {
                {
                    stringstream num;
                    num << "LD" << dcount << ".JPEG"; // uses the counter for the file name
                    temp = num.str();
                }

                cout  << temp << endl;
                if (!dimage[dcount].LoadFromFile(temp))
                    cout << "Error" << endl;
            }


For some reason it gets an error loading the image.
Post if you want to see more of the code.[/code]

Error which appears on the console
Failed to load image "LD1.JPEG". Reason : Unable to open file
Failed to load image "LD2.JPEG". Reason : Unable to open file
Failed to load image "LD3.JPEG". Reason : Unable to open file
Failed to load image "LD4.JPEG". Reason : Unable to open file
Failed to load image "LD5.JPEG". Reason : Unable to open file
Failed to load image "LD6.JPEG". Reason : Unable to open file
Failed to load image "LD7.JPEG". Reason : Unable to open file
Failed to load image "LD8.JPEG". Reason : Unable to open file
Failed to load image "LL1.JPEG". Reason : Unable to open file
Failed to load image "LL2.JPEG". Reason : Unable to open file
Failed to load image "LL3.JPEG". Reason : Unable to open file
Failed to load image "LL4.JPEG". Reason : Unable to open file
Failed to load image "LL5.JPEG". Reason : Unable to open file
Failed to load image "LL6.JPEG". Reason : Unable to open file

And the paths are correct because i had the files in a folder the first time, then i placed them in the source file location and still nothing.

9
SFML website / Tutorials
« on: February 12, 2010, 03:59:27 am »
Quote from: "Nexus"
Quote from: "rockstar8577"
Well, in my computer class we usually just learn what the function is what it does and how to do it. Then we go and do a program or two with it. With these tutorials it seems more like he tells you what it is and does and that's it.
You mean the programming part is missing? Hey, that's your task, not SFML's. ;)

As stated, you'll find a lot of code examples in the forums, the wiki and some even in the SDK.


No i think its more of giving me someway to implement it, like to make a small program using the function.

10
SFML website / Tutorials
« on: February 06, 2010, 08:28:23 pm »
Well, in my computer class we usually just learn what the function is what it does and how to do it. Then we go and do a program or two with it. With these tutorials it seems more like he tells you what it is and does and that's it. I don't know maybe its just me.

11
SFML website / Tutorials
« on: February 05, 2010, 04:34:08 am »
I was wondering if you could maybe make some more in depth tutorials. The tutorials are fine, it explains them but it doesnt really give the reader a feel of using it. Well not for me anyways i was wondering if others thought the same.

12
General / string.SetText()
« on: January 24, 2010, 07:09:41 pm »
Is there a way to set the text of a string to a float, or an integer?

*Edit*
Thanks Laurent, i saw what you posted on another topic that had the same question. :)

Incase anyone needs the same answer

//Modified for SFML
#include <sstream>

var variable_name = x;
std::stringstream out;
out << variable_name;
sting_name.SetText(out.str());

//Original Way
#include <sstream>

int i = 5;
std::string s;
std::stringstream out;
out << i;
s = out.str();

Pages: [1]