dennis Posted September 5, 2011 Share Posted September 5, 2011 Hello Community, is there any documentation for the VB.net wrapper? with little examples to use camera commands or other important functions? I'm using Leadwerks engine 2.5 and Project builder with VB.net project creator. it would be great if there is such a thing. Please pm me or reply here. Cheers, Dennis Quote Link to comment Share on other sites More sharing options...
Canardia Posted September 5, 2011 Share Posted September 5, 2011 It should be the same as the C++ tutorials, just add "LE." in front of all engine commands. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted September 6, 2011 Share Posted September 6, 2011 The sample generated when using LEBuilder should give you a hint. As Metatron says, its just a matter of adding LE. in front of the commands. Here is the sample generated by LEBuilder. Imports LeadwerksEngine Module test Sub UpdateCallback(ent As TEntity) LE.TurnEntity(ent, New TVec3(LE.AppSpeed() * 0.5F)) End Sub Sub ErrOut(ByVal message As String) Console.WriteLine(message) End Sub Sub Main() Dim ScreenWidth As Integer = 800 Dim ScreenHeight As Integer = 800 Dim MediaDir As String = "C:/GameDevel" Dim AppTitle As String = "test" ' Initialize LE.Initialize() LE.SetAppTitle(AppTitle) LE.RegisterAbstractPath(MediaDir) ' Set graphics mode If LE.Graphics(ScreenWidth, ScreenHeight) = 0 Then ErrOut("Failed to set graphics mode.") Return End If ' Create framework object and set it to a global object so other scripts can access it Dim fw As LeadwerksEngine.TFramework = LE.CreateFramework() If fw.IsValid = False Then ErrOut("Failed to initialize engine.") Return End If ' Set Lua framework object LE.SetGlobalObject("fw", fw.Handle) ' Set Lua framework variable Dim lua As Object = LE.GetLuaState() LE.lua_pushobject(lua, fw.Handle) LE.lua_setglobal(lua, "fw") LE.lua_pop(lua, 1) ' Get framework main camera Dim camera As LeadwerksEngine.TCamera = LE.GetLayerCamera(LE.GetFrameworkLayer(0)) LE.PositionEntity(camera, New LeadwerksEngine.TVec3(0, 0, -2)) ' Create cube Dim material As LeadwerksEngine.TMaterial = LE.LoadMaterial( "abstract::cobblestones.mat" ) Dim mesh As LeadwerksEngine.TMesh = LE.CreateCube() LE.PaintEntity(mesh, material) ' Apply Callback Dim cb As LE.EntityUpdateWorldCallback = New LE.EntityUpdateWorldCallback(AddressOf UpdateCallback) LE.SetEntityCallback(mesh.Entity, cb) ' Create ground Dim ground As LeadwerksEngine.TMesh = LE.CreateCube() LE.ScaleEntity(ground, New TVec3(10, 1, 10)) LE.PositionEntity(ground, New TVec3(0, -2, 0)) LE.PaintEntity(ground, material) ' Add some light Dim light As TLight = LE.CreateDirectionalLight() LE.RotateEntity(light, New TVec3(45, 45, 45)) ' Spin cube until user hits Escape While (LE.KeyHit() = False And LE.AppTerminate() = False) If LE.AppSuspended() = False Then LE.UpdateFramework() LE.RenderFramework() LE.DrawText("Visual Basic LE.NET", 0, 20) LE.Flip(0) End If End While LE.Terminate() End Sub End Module Hmm.. there seems to be a syntax color error in the tag in this board for VB code. Parts of the code get colored green as comments while they are not. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
dennis Posted September 6, 2011 Author Share Posted September 6, 2011 thanks guys. is there also a possibility to hide the very annoying command prompt window? regards, Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 6, 2011 Share Posted September 6, 2011 Hmm.. there seems to be a syntax color error in the code tag in this board for VB code. Parts of the code get colored green as comments while they are not. just end your commented parts with a comma as well... like so: ' Initialize' LE.Initialize() LE.SetAppTitle(AppTitle) LE.RegisterAbstractPath(MediaDir) ' Set graphics mode ' If LE.Graphics(ScreenWidth, ScreenHeight) = 0 Then ErrOut("Failed to set graphics mode.") Return End If ' Create framework object and set it to a global object so other scripts can access it' Dim fw As LeadwerksEngine.TFramework = LE.CreateFramework() If fw.IsValid = False Then ErrOut("Failed to initialize engine.") Return End If Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
dennis Posted September 6, 2011 Author Share Posted September 6, 2011 I know what you guys mean I code VB for several years now. but not in game engine style so that's new to me Quote Link to comment Share on other sites More sharing options...
ZioRed Posted September 6, 2011 Share Posted September 6, 2011 thanks guys. is there also a possibility to hide the very annoying command prompt window? regards, I don't remember currently, but may be you can avoid the prompt using a Form application instead of Console application, though I think it isn't included a template for that but you can easily do that, just try to create a new Form application project, add the reference to LE.NET.dll (it is in the SDK folder) and put the example code in the Program.Start (I don't remember if it's the same as C#). As mentioned, I don't remember if it will avoid the console prompt, because it is created by the engine itself. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
dennis Posted September 6, 2011 Author Share Posted September 6, 2011 I don't remember currently, but may be you can avoid the prompt using a Form application instead of Console application, though I think it isn't included a template for that but you can easily do that, just try to create a new Form application project, add the reference to LE.NET.dll (it is in the SDK folder) and put the example code in the Program.Start (I don't remember if it's the same as C#). As mentioned, I don't remember if it will avoid the console prompt, because it is created by the engine itself. thanks will try tomorrow, do some more of you guys have that annoying command prompt window? Cheers Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 7, 2011 Share Posted September 7, 2011 With the standard project setup we pretty much all do I thnk. At least in C++ you do as well. I don't mind it too much tbh because I use it for debugging. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Canardia Posted September 7, 2011 Share Posted September 7, 2011 The command-prompt window can be enabled/disabled by setting in your IDE windows/console app mode. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
L B Posted September 7, 2011 Share Posted September 7, 2011 thanks will try tomorrow, do some more of you guys have that annoying command prompt window? Cheers Right click your project. Select "Properties...". In "Output type", select "Windows Application" instead of "Console Application". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.