Jump to content

Any VB.net documentation?


dennis
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

AV MX Linux

Link to comment
Share on other sites

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

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

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.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...