Bindings - other languages => DotNet => Topic started by: Sonitek on June 06, 2017, 07:02:22 am
Title: Detecting entered text in C# (help required)
Post by: Sonitek 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?
Title: Re: Detecting entered text in C# (help required)
Post by: Laurent 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.
Title: Re: Detecting entered text in C# (help required)
Post by: dabbertorres 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
Title: Re: Detecting entered text in C# (help required)
Post by: Sonitek 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.
Title: Re: Detecting entered text in C# (help required)
Post by: dabbertorres 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!