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

Pages: 1 2 [3] 4 5 6
31
SFML projects / SFGUI
« on: November 05, 2011, 07:20:45 pm »
Ive run into a problem. I cant add anything into a window becuase it gives an error
Code: [Select]
undefined reference to `_imp___ZN3sfg9Container3AddEN5boost10shared_ptrINS_6WidgetEEE'|
Also, I tried to do a button by itself but there are problems with that to. When I create a button and run in debug mode, all i get is a black screen, even if all i do is Create() it.

32
Graphics / Atom Zombie Smasher feature
« on: November 04, 2011, 07:23:10 pm »
hey guys. I recently bought atom zombie smasher, and i found out that it uses SFML. Its wierd because when the game opens, the window creation is really smooth, but when i make an SFML app fullscreen, the screen goes black for a second(which also happens with other games). Does anyone know how the creator managed to do this?

33
SFML projects / SFGUI
« on: November 04, 2011, 07:12:07 pm »
so ive been looking at the examples. It looks like everything requires a window. Is it possible to do without?

34
SFML projects / SFGUI
« on: November 03, 2011, 06:52:01 pm »
oh yeah and i forgot to mention the test app exe provided doesnt work on my comp. It'll hang for a few minutes, and then randomly pop out button and stuff. its wierd.

35
SFML projects / SFGUI
« on: November 03, 2011, 12:44:50 am »
ive checked it, but its kinda confusing. a small tutorial of the very basics would be very helpful

36
SFML projects / SFGUI
« on: November 02, 2011, 09:28:48 pm »
hey tank. I managed to compile sfml, buut i cant use it. I looked at the test source but its really confusing, so it would be great if you could right one or two guides or tutorials. thanks

37
SFML projects / SFGUI
« on: October 31, 2011, 06:40:33 pm »
god i hate cmake. Is it possible for you to just put up the compiled binaries, like on the download page for sfml?

38
SFML projects / SFGUI
« on: October 30, 2011, 11:34:20 pm »
So how do i set the paths? do i do it on the command line with cmake or something?

39
Graphics / Problem with TileMap
« on: October 25, 2011, 08:08:19 pm »
When you use a Tile inside a vector, it makes a copy of the Tile, and the location of the Image in memory is changed. After you push_back, you need to reassign the Image to the Sprite.
For example add a function to the Tile class:
Code: [Select]

class tile {
public:
   tile(std::string Path, float X, float Y, float Rotation, bool bCollision);
   ~tile();
//right here
   void reAssign(){
sTile.SetImage(iTile);
}
public:
   float X, Y, Rotation;
   bool Collision;
   sf::Sprite sTile;
   sf::Image iTile;
};

Then after
Code: [Select]
Map.push_back(TempTile123);
add
Code: [Select]

Map[(the one you just put in)].reAssign;

40
Graphics / Creating std::vector of sf::Image/Sound
« on: October 22, 2011, 02:27:27 am »
Quote
Absolutely. The only thing that you must keep in mind is that some operations (such as adding an element) may move all the vector elements elsewhere in memory, invalidating all the sprites that previously pointed to them.


Okay, so I have an object that has a Image member and a Sprite member.
I create one of those objects, change a few options, and push it into a an vector, change a few options, push it into a vector, repeating until I have enough.The sprites that I draw all turn white. Is it because of what you're talking about?, and if so, how do I fix it?

41
General / Keep seeing: error: expected ')' before '&' token ?
« on: October 11, 2011, 08:18:23 pm »
i think you have to delete the protected..but im not sure..

42
Graphics / Creating Buttons
« on: September 30, 2011, 02:05:47 am »
Quote from: "Lo-X"

Now, if you want, you can add an action to execute when the button is clicked. This is more complicated.

Id rather not do that. I just check the variable when ever I want to do something. This button is actually an on/off button, not a click and do something button.(does tht make sense?)

43
Graphics / Creating Buttons
« on: September 28, 2011, 09:35:42 pm »
Im feeling enerous. I just made this yesterday.
Code: [Select]

class Button {
public:
    Button (sf::Image* normal,sf::Image* clicked,std::string,sf::Vector2f location);
    void checkClick (sf::Vector2f);
    void setState(bool);
    void setText(std::string);
    bool getVar();
    sf::Sprite* getSprite();
    sf::String * getText();
private:
    sf::Sprite normal;
    sf::Sprite clicked;
    sf::Sprite* currentSpr;
    sf::String String;
    bool current;
};

Button::Button(sf::Image* normal,sf::Image* clicked,std::string words,sf::Vector2f location) {
    this->normal.SetImage(*normal);
    this->clicked.SetImage(*clicked);
    this->currentSpr=&this->normal;
    current =false;
    this->normal.SetPosition(location);
    this->clicked.SetPosition(location);
    String.SetText(words);
    String.SetPosition(location.x+3,location.y+3);
    String.SetSize(14);
}
void Button::checkClick (sf::Vector2f mousePos) {
    if (mousePos.x>currentSpr->GetPosition().x && mousePos.x<(currentSpr->GetPosition().x + currentSpr->GetSize().x)) {
        if(mousePos.y>currentSpr->GetPosition().y && mousePos.y<(currentSpr->GetPosition().y + currentSpr->GetSize().y)) {
            setState(!current);
        }
    }
}
void Button::setState(bool which) {
    current = which;
    if (current) {
        currentSpr=&clicked;
        return;
    }
    currentSpr=&normal;
}
void Button::setText(std::string words) {
    String.SetText(words);
}
bool Button::getVar() {
    return current;
}
sf::Sprite* Button::getSprite() {
    return currentSpr;
}

sf::String * Button::getText() {
    return &String;
}


It still needs some work, though.

44
General discussions / Who Are You? (the obligatory interview thread)
« on: September 09, 2011, 11:07:14 pm »
lol I dont get whats so bad about it. I used it for quite a while, and now I do C++.I havent been "fected"(i think)

45
Graphics / SubRect
« on: September 09, 2011, 04:49:06 am »
Im using 2.0. I know it works fine cuz ive been using the same code for a while from 1.6. All I did was cahange some things like textures instead of images, pollevent instead of getevent, etc. the base of the code is the same.

Pages: 1 2 [3] 4 5 6