|
Re: C# wrapper 2.2.1 - RELEASE
[Re: monotonic]
#364717
03/20/11 08:58
03/20/11 08:58
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
I've uploaded an example which shows how you can call a C# function from lite-c, here's the link to the downloadable project linki too think that using c# for the scripts is most likely easier than using lite-c!
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: Stromausfall]
#364718
03/20/11 09:27
03/20/11 09:27
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Is a game written in C# using gamestudio faster or slower than writing it in lite-c? A small test would be cool (a huge crowd of entities that perform a function).
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: Stromausfall]
#364779
03/20/11 19:31
03/20/11 19:31
|
Joined: Mar 2011
Posts: 13 Yorkshire, England
monotonic
Newbie
|
Newbie
Joined: Mar 2011
Posts: 13
Yorkshire, England
|
@Stromausfall Thank you very much I will have a play around and see what I can do. I have noticed though that you (or at least I believe) can only load one script when opening the world as opposed to loading scripts at will. If this is the case then I will have to go with C# as the scripting language.
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: monotonic]
#365250
03/24/11 20:46
03/24/11 20:46
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I finally had time to look into your wrapper. I love it!
One bug I noticed: The ent_nextvertex() method of the ENTITY class doesn't work if null is passed for the first parameter (contact). Although this is possible in Lite-C!
The most interesting example was the embedded engine window example. One problem I noticed is, that even if the parent window (the window the engin is embedded in) is active, I need to click into the engine window so that acknex detects my key strokes. Is it possible to activate the engine window when the parent window is active? I also didn't managed to get resizing of the engine window with the parent window to work... The panel is resizing correct. In the resize event of the panel I tried to change the engine resolution to the current panel size... without an effect (I used the threadsafe event of your scheduler of course).
Really great work!
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: Stromausfall]
#365256
03/24/11 21:29
03/24/11 21:29
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
For the window stuff... To resize the engine to the resolution of the container, overload the WndProc and catch WM_RESIZE, then pass the call onto the engine Handling the 'Resized' event of a .NET control would also do As for the keystroke stuff, It's something I have been trying to resolve for some time. This is a consequence of the SetParent call, as I've seen this behaviour in other apps unrelated to GameStudio. I think the function 'AttachThreadInput' may hold the key A workaround is to simply overload the container WndProc, catch any WM_KEYDOWN, etc messages, and pass them onto the acknex window handler good luck
Last edited by DJBMASTER; 03/24/11 21:31.
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: DJBMASTER]
#365291
03/24/11 23:46
03/24/11 23:46
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
experimented a bit and came to the same conclusion as DJBMASTER ^^ works pretty good, but as DJBMASTER wrote, WndProc has to be overloaded It would be interesting to see how mouse interaction works with this method !
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: Stromausfall]
#365377
03/25/11 23:28
03/25/11 23:28
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
I've experimented with the original method of embedding the window and after quite some time found a way to resize the window and also give the impression/(or even manage ^^) that the focus is correctly switched according to the mouse position and the status of the main form.... It uses some dirty tricks, but should works quite good (at least it does on my pc ^^) ImprovedEmbeddedWindow.zip
|
|
|
Re: C# wrapper 2.2.1 - RELEASE
[Re: Stromausfall]
#365407
03/26/11 12:19
03/26/11 12:19
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Wow thank you very much!
Resizing works already perfect!
But I noticed a problem with the focus thing. If the main form creates a dialog that is placed over the engine window, you will be unable to click a button in this dialog. Another problem of this solution is, that the mouse has to be over the engine window so that key strokes are recognized. I think I will use the keydown event of the form and forward the key strokes to the engine window if the mouse isn't over the window.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|