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 - Lo-X

Pages: 1 ... 26 27 [28] 29
406
Window / Strange things with Gamepad
« on: August 15, 2011, 10:22:20 pm »
Quote from: "Laurent"
How do you know what your gamepad number is?

Je vais illustrer mon propos :

Je dois utiliser une boucle pour avoir tous les numéros de Joystick :
Code: [Select]
int JoystickNumberTable[8], j = 0;
for(int i = 0; i < 8; i++)  
     if(sf::Joystick::IsConnected(i)) {  
          JoystickNumberTable[j] = i;
          j++;
     }

(Chez moi, je récupère toujours deux nombres : 0 et 1)

Puis, lorsque je veux vérifier si le joystick est tourné ou non :

Code: [Select]
for(int i = 0; i < j; i++)
            {
                if(sf::Joystick::GetAxisPosition(JoystickNumberTable[i], sf::Joystick::X) < -40)
                        cout << "Turn Left !" << endl;
            }


Si je récupère le premier numéro de Joystick trouvé avec IsConnected(NUMERO), sf::Joystick::GetAxisPosition(   NUMERO   , ...) retourne des valeurs comprises entre -3 et 3 (à quelques décimales près).

Mais je viens de me dire que le premier numéro trouvé correspond au stick POV de la manette, même si en le tournant également, rien ne se passe.

Je ne sais pas si c'est clair ^^
Sorry for english speaking people :/

407
Window / Strange things with Gamepad
« on: August 15, 2011, 08:13:15 pm »
Hello

I tried the last build of SFML 2 with the new sf::Joystick and I saw a strange thing while using it with a gamepad, I don't know if it's normal or not.

If I Use this code :

Code: [Select]
int main(void)
{
      // App = sf::RenderWindow
     sf::Joystick::Update();
     int MyJoystickNumber = 0;
     for(int i = 0; i < 8; i++)    
          if(sf::Joystick::IsConnected(i)) {  
               MyJoystickNumber = i; break;
          }

     // Some code

     // Problematic code
     if(sf::Joystick::GetAxisPosition(MyJoystickNumber, sf::Joystick::X) < -40)
          cout << "Turn Left !" << endl;
}


In fact, "Turn Left !" just never appear, the Joystick number is not my gamepad number and I've nothing else than a mouse and a keyboard on the computer.

If I have a table of joystick's numbers and I check all these joysticks, the message appear.
So my game works well and the new interface is nice, but I'm obliged to check 2 Joysticks instead of one in a single game loop.

408
SFML website / Switching from phpBB2 to SMF
« on: August 13, 2011, 10:14:12 pm »
Quote from: "Laurent"
I hope that database converters are now working, and that support for sharing a common users database between two forums is better.


Ah, my question was : what about existing threads, I've my answer.

Feel free to change, but I like when it's simple and clear

409
General / ERROR!
« on: August 03, 2011, 08:12:37 am »
I think it comes from there :

Code: [Select]
Heart[2].SetImage(heart1);
Heart[2].Scale(2.0f, 2.0f);


Look at the declaration :

Code: [Select]
sf::Sprite Heart[2];

410
Graphics / Shader not working on "newer" machines
« on: June 29, 2011, 09:57:15 pm »
Quote from: "heishe"
They certainly are. I also doubt that this is a driver problem.

Has anyone here tried the shader? It's not that hard to test. Just draw a sprite using this shader, and set the values of the variable to whatever you want them to be.


give us the C++ code, the GLSL code can't work like this.

411
Graphics / Shader not working on "newer" machines
« on: June 28, 2011, 01:23:49 pm »
The code don't work.
Do you send the variable to the GLSL code ?
Because some aren't initialized if you use this code like this

412
Graphics / [Solved] How to : Flash light
« on: June 28, 2011, 01:19:54 am »
Quote from: "Jove"
Hope this helps.


Yes a lot. Big fat thank you :D
Ps: I've made my own flash image

413
Graphics / [Solved] How to : Flash light
« on: June 27, 2011, 10:07:42 pm »
Yes if you can show me an example
I thought about the blend mode while reading a light tutorial

and.. thank you !

414
Graphics / [Solved] How to : Flash light
« on: June 27, 2011, 07:34:40 pm »
Quote from: "Cuban-Pete"
You could flash the whole screen with a white image. ...but people might get an hearth attack because of it. What you could also do is shake the camera a little.  :)


Shake the camera is a great idea, but flash the whole screen is a bit radical.


Edit : I found this : http://www.gamedev.net/topic/304874-looking-for-spotlight-shader-tutorial/
Someone say that Shader is not the great solution, so I will searsh with the light manager tutorial on the wiki

415
Graphics / [Solved] How to : Flash light
« on: June 27, 2011, 07:20:21 pm »
Hi,

I would like to have a big Flash Light for my game when something explode.
But I don't know how to proceed, I think that I may use Shaders, but on what ?
A sprite ? The shader will only be applied on the texture of the sprite so, bad idea
A render image ? But how can I have the flash ?

If you have some advices, it will be with pleasure =)

416
System / DeltaTime question
« on: June 27, 2011, 11:56:23 am »
1000 ms = 1 s

So you can multiply your window.GetFrameTime() by 1000 to have it in seconds :
Code: [Select]
float deltaTime = 1000.0f/window.GetFrameTime();

Then you have to try values for the speed of your sprite (here : moveVector.x = 10.f * deltaTime; )

417
Graphics / Question about sf::RenderImage
« on: June 27, 2011, 02:26:41 am »
Quote from: "Groogy"
It won't, it was removed a long time ago.


Thank's !

So, Laurent, c'est toujours dans les exemples sur sf::RenderImage dans la doc =)

418
Graphics / Question about sf::RenderImage
« on: June 26, 2011, 11:37:41 pm »
Just a simple question :

Why would sf::RenderImage::IsAvailable() return false ? (For what reason(s)) ?

420
Graphics / why is my sprite blurred?
« on: June 22, 2011, 04:24:04 am »
if you had tried it with a simple png image with transparency, you would know that it works :)

Pages: 1 ... 26 27 [28] 29