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

Pages: [1]
1
General / Nesting Events
« on: March 03, 2016, 03:46:14 am »
Hi All , I Am New To SFML and Still Learning .

while i was learning i came across something i don't understand so if anyone would kindly clear things up for me i would be very much appreciated Thank's

The Problem is why i can't use nesting events to check for an Event When another Event Happens Like This :

if (ev.type == Event::MouseButtonPressed && ev.mouseButton.button == Mouse::Left)
          if (ev.type == Event::MouseButtonPressed && ev.mouseButton.button == Mouse::Right)
          {
               leftClick = true;
               rightClick=true;
          }

In TH Previous Example i Check For The Left Key if Pressed and if so i Check For Right Key If Pressed But It
Seems That The 2nd Nested If is never Checked why is This ?

Pages: [1]