Adam's Lair Forum

game development and casual madness
It is currently 2020/01/28, 19:33

All times are UTC + 1 hour [ DST ]

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2015/12/17, 20:56 

Joined: 2015/12/17, 19:26
Posts: 3
Location: France
Role: Hobbyist
I've just started to use Duality, and my first idea was "I see everywhere that Duality handles the C# code to customize components, but I hope they think about crazy VB coders like me !"

Yes, shame on me maybe, but my first love was VB and not C#, and I'm really more efficient to code on VB. So, it's the reason why I decided to provide to this community a little tutorial to create a compatible VB project to work your Duality project :D

1 - After you setup your Duality project, just click the "Open Sourcecode" button in the "File" menu, or in the toolbar (The C# icon).

2 - After Visual Studio is open and ready, go to the "File" menu, then "Add", then "New project..."

3 - In the "Add New Project" dialog, find the "Class Library (Portable)" in Visual Basic and select it. Give a name to your project and, very important thing DON'T CHANGE THE LOCATION :exclaim: The default one is the good one to avoid any problem with Duality.

4 - Depending on Visual Studio I guess, you may have one more dialog to complete. This dialog ask you for the Framework target. Choose the .NET Framework 4.5 (Maybe it also works with newer versions but I haven't try).

5 - After your empty VB project is added to your solution, you have to display its properties. For that, the simpliest way is to double click on the "My Project" node, just under the project name inside the solution explorer tree.

6 - A new tab is open with the name of your project. Inside, there are tabs that you can select on the left side. Select the "References" tabs, then click the "Add" button. A new dialog appears to register some librairy dependancies on your project. Click on the "Browse..." button and navigate to your Duality project folder. Select the "Duality.dll" and the "DualityPrimitives.dll" files and valid. Click "OK" and now, your VB project understand all the main things of Duality.

7 - It's not enough ! From now, your project is able to contain Component and Resource classes for example, but Duality can not access to your classes yet. You need to add post build events. To do that, select the "Compile" tab and click the "Build Events..." button. Then, copy the next 3 lines in the "Post-build event command line" text box :
mkdir "$(SolutionDir)../../Plugins"
copy "$(TargetPath)" "$(SolutionDir)../../Plugins"
xcopy /Y "$(TargetDir)*.xml" "$(SolutionDir)../../Plugins"
Then, click the "OK" button.

8 - It's done, now your project is totally integrated to Duality, and you can code in VB all the beautiful components you want ! What a dream B)

Feel free to comment this tutorial in order to improve it. It may be incomplete since I've done it with Visual Studio 2015 Pro, and it's possible that there is some gaps between different Visual Studio versions.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group