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

Pages: 1 [2]
16
Graphics / Re: Draw "not standard" char
« on: June 13, 2013, 10:56:00 pm »
hi,

Thanks for the fast answer.
However, std::wstring can't work for me because I'm using method needing 'std::string' argument.
I wanted to try with \u, it works, but I get the same character : instead of Ω , i get a '?' char

string resistorUnit = "M";
        resistorUnit.append("\u03A9");
        //mResistor->drawIn(window,font,"MO",COLOR_RESISTOR);
        mResistor->drawIn(window,font,resistorUnit,COLOR_RESISTOR);

17
Graphics / [SOLVED] Draw "not standard" char
« on: June 13, 2013, 10:13:52 pm »
Hello,

I want to draw some unusual characters like Ω. I know it is possible because when I do like this :

text.setString(L"Ω");

It works.
however, I want to do something much more like this :

string newText="blablaΩΩΩ";
text.setString(newText);

( Sorry for not putting the 'code part' not in between good tag but you can see just above that I had some issues displaying Ω in [ code ] tag. )
This displays '?' instead of 'Ω' . Is that possible to cast a string as a "L string" ? If so, how shall I do this ?

Thanks,

Gabriel

18
Window / Re: Put Window in foreground
« on: June 12, 2013, 06:01:33 pm »
Ok, that's a shame =p.

Thanks for the fast answer!

19
Window / [SOLVED] Put Window in foreground
« on: June 12, 2013, 05:19:29 pm »
Hello,

I was wondering if there was a way to put a window on the foreground.
To be precise, let's imagine you have 2 different windows, window1 and window2. Both are visible and displayed. When you are on window1, I would like to set window2 on the foreground when i click on a button from window1 without having to re-create window2 (it works to recreate window2, but I don't want to have to re-load all elements from window2 which are already displayed), I just want to make window2 go on foreground.

If this is possible, please tell me how.

Thanks in advance,

Gabriel

20
General / Get the key pressed on keyboard
« on: June 05, 2013, 05:45:10 pm »
Hello,

After reading the tutorial on event/keyboard, I was wondering if we had to make all tests like that :
Code: [Select]
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) {}
Or if it was possible to get the char/stream entered on the keyboard, thus doing the test much more like that :
Code: [Select]
if (event.type == sf::Event::KeyPressed)  // in the "while (window.pollEvent(event))" loop
{
  // getKeyPressed
  // use the input on keyboard
}
Is this possible ? and if so, how can we catch this (into a sf::Text) as an example ?
If this is not possible, can I get help on how to do it manually ?

Thanks !

21
General / SFML in a Qt Window using Visual Studio
« on: June 04, 2013, 10:47:13 pm »
Hey,

I am trying to integrate SFML 2.0 in a QT larger Window, and I'm using Visual Studio 2010.
Any one got an idea on how to link these elements ? (SFML works well on Visual Studio, but I have no idea how to add Qt to it).

Thanks a lot,

Gabriel.

22
Window / [SOLVED] Remove Resize Function
« on: June 04, 2013, 05:08:19 pm »
Hello,

I am confused about how to do this : I just want the user not to be able to re-size the window. Is this possible ?
Also, is this normal that the scale of the objects in the scene doesn't move while we change the window size ?

Thanks by advance!

EDIT : sorry, I don't know how the search function works. However, I've just seen that there was a post answering the question.

23
Window / Re: MouseClic / MousePressed
« on: May 31, 2013, 11:19:33 pm »
Hello and thanks.. Just, if I understood well,
do you mean i have to do it this way :

Code: [Select]
sf::Event event;
 while (window.pollEvent(event))
 {
     if (event.type == sf::Event::Closed)
         window.close();
     // else if -> event on mouse
 }

24
Window / [SOLVED] MouseClic / MousePressed
« on: May 31, 2013, 09:02:40 pm »
Hello guys !
I have a little question about mouse event : I do not want to be in the polling loop (that's cool because actually, the mouse can be handled separatly). However, when I clic on the window, the meter counting the number of clics don't increase by 1 but increase depending on how long I let the mouse button pressed.
Question : is it possible to get only once in the loop ( thus triggering the event on the clic and not on the pressed action ) ?
Here is the code :

if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
        sf::Vector2i localPosition = sf::Mouse::getPosition(window);
        if ((myElectrode->getShape()).isPositionInside((sf::Vector2f) localPosition)) // the function always return true at the moment
        {
                count++;
                string windowTitle = to_string((long double) count);
                window.setTitle(windowTitle);
        }
}
 

Thanks in advance,

Gabriel.

25
Graphics / event on a clic on a Shape
« on: May 31, 2013, 03:03:30 pm »
Hello guys !

I am new to SFML ( how come I didn't know about it before :P ), and looking at the documentation + some topics on the forum, I didn't find function that permits to get an event if the user clicks on a ConvexShape.
If you have any idea/solution, I would like to have advices.
( I've seen the function getGlobalBounds, But I'd rather have the shape itself and not a rectangle containing the shape ).

Thanks in advance,

Gabriel.

Pages: 1 [2]