Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Detecting entered text in C# (help required)  (Read 2958 times)

0 Members and 1 Guest are viewing this topic.

Sonitek

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Detecting entered text in C# (help required)
« on: June 06, 2017, 07:02:22 am »
So, to be honest, I'm not quite sure why nobody bothered making a C# tutorial for the SFML library that teaches this kind of basics, so I'm currently stuck with an excellent question:

How does one detect entered text in SFML .NET for C#? I googled and googled and googled, and I only find C++ examples, which kinda don't work at all with C#.

Help please?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Detecting entered text in C# (help required)
« Reply #1 on: June 06, 2017, 07:43:11 am »
The API is the exact same, you just have to adapt the syntax to the language. And for that, you have the various examples included in the SFML.Net SDK.
Laurent Gomila - SFML developer

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Detecting entered text in C# (help required)
« Reply #2 on: June 06, 2017, 07:03:09 pm »
For the C# bindings, all SFML events are accessible via C# events, as members of a window.

So you'd do something like:
yourWindowObj.EventOfInterest += YourHandleFunc

Sonitek

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Detecting entered text in C# (help required)
« Reply #3 on: June 14, 2017, 03:39:45 am »
So, basically, assign a function to the event like one should in C#, then use the args. Sorry for the annoyance.

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Detecting entered text in C# (help required)
« Reply #4 on: June 14, 2017, 07:51:04 pm »
So, basically, assign a function to the event like one should in C#, then use the args.
Yep, exactly that!

No worries!

Fyi, the source is well documented and straightforward to read through public fields and function signatures, so that might be a helpful (and quicker) solution if you can't find something else in the future!

 

anything