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 - Mitmischer 1703

Pages: [1]
1
General discussions / How to create a build menu with the SFML view
« on: May 15, 2011, 06:51:45 pm »
hi, thanks for your answers!

So I have to determine the coodinates manually, or can I set an alignment?

2
Graphics / scaling with absolute values
« on: May 03, 2011, 10:19:14 pm »
hi!

How can I set the scale of a sprite in absolute values? I want to have a sprite which is always 400x400, no matter the original size.

3
General discussions / How to create a build menu with the SFML view
« on: May 01, 2011, 03:01:11 pm »
hey there, you are absolutly right. So, what should I do instead?

4
General discussions / How to create a build menu with the SFML view
« on: May 01, 2011, 12:15:52 pm »
Hi!

I'm having trouble creating a build menu like that one shown in this picture (http://www.mobygames.com/images/shots/l/282897-supreme-commander-forged-alliance-windows-screenshot-new-hud.png).

I've figure a view would do the the job, but I cannot imagine how this works. Can anyone give me the basic idea how to do it?

5
Graphics / SFML 1.6, ConvertCoords does not work properly
« on: April 18, 2011, 12:51:25 pm »
Hi there!

i have a problem using the ConvertCoords-method of window.

I'll first describe, what I want to do. When the user clicks, I want a new circle to appear on the screen. I'm performing a scroll when the mouse touches a border, so I the mouse coordinates themselves wouldn't do anymore. So I found the ConvertCoords-method and tried to determine the real position of a new shape like this:

Code: [Select]
sf::Vector2f convertedCoords = App->ConvertCoords(static_cast<unsigned int>(x),static_cast<unsigned int>(y));

x and y are the last known coordinates of the mouse, I determine them in the message loop, like this:

Code: [Select]
// left mouse button released
            if (Event.Type = sf::Event::MouseMoved)
            {
                // Save mouse position
                x = Event.MouseMove.X;
                y = Event.MouseMove.Y;
            }

Then I initialize a new shape with the newly calculated coordinated and display it. But it does only seldom work, as soon as I'm close to any border(around 200px distance), x is simply ignored. I'm working on uploading an executable.

My shape is initialized like this:

Code: [Select]
new sf::Shape(sf::Shape::Circle(50,50,50, sf::Color(0,25,60), 6, sf::Color(255,23,65)));

Later I change the coordinates to x and y from above via

Code: [Select]
img->SetPosition(X,Y);

What do I do wrong?

6
General / SFML 1.6 - Window won't react
« on: April 15, 2011, 07:36:14 pm »
Hi, I have to annoy you once again!

I have following code to create a black window:

Code: [Select]
#include <SFML\Window.hpp>
int main()
{
    sf::Window App(sf::VideoMode::GetMode(0) , "SFML Window");
    while (true)
        App.Display();
    return 0;
}


The window appears but it just doesn't react - I can't close it nor move or resize it. I am linking statically, the examples, that link dynamically, work fine. But when I link them statically as well, they won't react either. If dynamic linking is the only solution, how can I do it? I get errors "undefined reference to ..." although I defined SFML_DYNAMIC. What have I forgotten?

7
General / SFML 1.6 - Problem with linking
« on: April 15, 2011, 05:43:53 pm »
Oh, you're so right! Sorry...

8
General / SFML 1.6 - Problem with linking
« on: April 15, 2011, 05:08:13 pm »
Hi!

I have a problem with linking my project. It compiles fine, but when linking, it says

Quote
undefined reference to `sf::Window::Display()'


I have included Window.hpp and I tried to display my window:

Code: [Select]
#include <SFML/Window.hpp>
App->Display();


What could I have forgotten? I'm using Code::Blocks and in the linker-tab, I've added libsfml-system.a as a library to link and -lsfml-system
as a parameter to the linker. The library is taken form the SDK, folder \lib. I am compiling with mingw g++, version 4.3.3.

Pages: [1]