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

Pages: 1 ... 3 4 [5] 6 7
61
General / sf::Text blurry
« on: October 15, 2011, 05:32:26 pm »
Hello all,

When i change the character size of my text, it gets blurry...
Is this a known issue?

Any work-arounds?

Thanks,
Xander

62
General / Thinking about making a GUI library
« on: October 14, 2011, 09:45:17 pm »
You don't understand, that means you can't pass the function...

63
General / Thinking about making a GUI library
« on: October 14, 2011, 06:16:33 pm »
I tried it, but it doesnt work:

Code: [Select]
error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function.  Say '&A::test'|

64
General / Thinking about making a GUI library
« on: October 14, 2011, 05:36:38 pm »
Yes, but then it should be called like this:

Code: [Select]
button.setOnClickCallback(bind(&A::test, &testclass));

Do you think that would be acceptable?
Or I could overload the function, one which takes just a function, and one which takes an object and a function (and call boost::bind() inside that function)

It's just that I don't know how to write a function that takes an object and an object's function...

65
General / Thinking about making a GUI library
« on: October 14, 2011, 04:49:27 pm »
I tried with boost::bind() but I couldn't get it to work. I mean, I should pass an object and one of his functions to setOnClickCallback() right?

66
General / Thinking about making a GUI library
« on: October 13, 2011, 07:59:25 pm »
I'm stuck! I can't figure out how to set a member function as a callback...
A normal function works perfectly:

I use typedef boost::function<void ()> callback.
But when I call my setCallback function with a member var it doesnt compile...

67
General / Got a new computer and my program won't work anymore?
« on: October 12, 2011, 10:28:47 pm »
I don't see  a reason to start with 1.6 now. 2.0 is right around the corner :D

68
General / Thinking about making a GUI library
« on: October 12, 2011, 10:27:21 pm »
Wow thanks for the awesome input Nexus :)
I decided to store a sf::FloatRect in the class.
Drawing:
Code: [Select]
void Draw(sf::RenderWindow* window)
{
    window->Draw(sf::Shape::Rectangle(box, fillColor, 3, outlineColor);
}


I've never worked with callbacks before, but it looks good :)
How would they work?
I store a function pointer in the object, and when (in checkEvent(const sf::Event& event) ) it detects that the mouse hovers over it, it calls it. Right?

I feel I'm going to learn so much from this :D[/code]

69
General / Thinking about making a GUI library
« on: October 12, 2011, 08:42:46 pm »
Hey forum,

I'm playing around with the idea of making a GUI library.
I have some design decisions to make and I brainstormed a bit while I was at school. I have some questions though:

- Is using sf::Shape for drawing the boxes a good idea?

- And should I derive from sf::Drawable or make a
Code: [Select]
void draw(sf::RenderWindow* window) function?

- How could I stretch and shrink buttons if I'd use images. I know I could make one image part for the middle (which I can stretch) and one for the sides. Are there any other methods to do this?

- For event checking, what would be a better approach:
Code: [Select]
void checkEvent(const sf::Event& event) //which checks all the possibilites

Or

Code: [Select]
void onHover()
void onClick()


Which are to be called manually? I'm leaning more towards the first.

Thanks in advance.

PS: If it goes well, I'll ofcourse make it public so other users can benefit from it too :)[/code]

70
SFML projects / Thor C++ Library – An SFML extension
« on: October 02, 2011, 08:03:41 pm »
This library is bawz :D
Keep it up, Nexus!

71
Graphics / SIGSEGV fault while using thor::FrameAnimation
« on: September 01, 2011, 09:18:57 am »
OMG!
I feel so stupid, 2 noob mistakes in 2 days :(
thanks, it works great now!

EDIT: How do I know when the animation finishes? Should I set my own sf::Clock for that? Because after it finishes I don't need to draw it anymore.

72
Graphics / SIGSEGV fault while using thor::FrameAnimation
« on: August 31, 2011, 10:14:07 pm »
It is stored...
Here's how I init:
Code: [Select]
void GameState::initAni()
{
    explosionSprite.SetTexture(im.getImage("explosion18.png"));
for(unsigned i = 0; i < 2050; i+=128)
        for(unsigned j = 0; j < 2050; j+= 128)
        {
            sf::IntRect temp(j, i, 128, 128);
            ani->AddFrame(1.f, temp);
        }
    ani->Apply(explosionSprite, 1.f);
    animator.AddAnimation("explosion", ani, 2);
}


Then I call:
Code: [Select]
void GameState::playExplosion(float x, float y)
{
    explosionSprite.SetPosition(x+50, y+50);
    animator.PlayAnimation("explosion");
    explosionCount++;
}
[/quote]

73
Graphics / SIGSEGV fault while using thor::FrameAnimation
« on: August 31, 2011, 03:27:45 pm »
I succesfully tested FrameAnimation to make an explosion, but when I use it in my game, it gives me a runtime error.
Code: [Select]
Assertion failed: itr != mAnimationMap.end()
in animator class


??

74
Graphics / SIGSEGV fault while using thor::FrameAnimation
« on: August 31, 2011, 12:47:13 am »
omg ofcourse! thanks nexus, and great lib!

75
Graphics / SIGSEGV fault while using thor::FrameAnimation
« on: August 30, 2011, 11:10:16 pm »
So I was checking out this awesome lib called Thor :)
This is my code snippet:
Code: [Select]
for(int i = 0; i < 701; i+=100)
        for(int j = 0; j < 701; j+= 100)
        {
            sf::IntRect temp(sf::Vector2i(i, j), sf::Vector2i(100, 100));
            ani->AddFrame(1, temp);
        }
    ani->Apply(spr, 50);

ani is a FrameAnimation ptr.

I really don't understand how that could happen...
The SIGSEGV points to a fault with a vector (probs the one that FrameAnimation class uses?)

Pages: 1 ... 3 4 [5] 6 7