Jump to content

Recommended Posts

Posted

Autocomplete / code suggestions would work with the functions shown here. What do you think?

--Get the displays
local displays = GetDisplays()

-- Create a window
local window = CreateWindow("Leadwerks", 0, 0, 1280, 720, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR)

-- Create a world
local world = CreateWorld()

-- Create a framebuffer
local framebuffer = CreateFramebuffer(window)

-- Create a camera
local camera = CreateCamera(world)
SetCameraClearColor(camera, 0.125)
SetEntityPosition(camera, 0, 0, -4)

-- Create a light
local light = CreateBoxLight(world)
SetEntityRotation(light, 45, 35, 0)
SetLightRange(light, -10, 10)
SetEntityColor(light, 2)

-- Create a model
local model = CreateBox(world)
SetEntityColor(model, 0, 0, 1)

-- Main loop
while not WindowClosed(window) and not KeyDown(window, KEY_ESCAPE) do
    TurnEntity(model, 0, 1, 0)
    UpdateWorld(world)
    RenderWorld(world, framebuffer)
end

 

  • Like 1
  • Thanks 1

Let's build cool stuff and have fun. :)

Posted
Just now, Dreikblack said:

I'm not quite understand what is this exactly. Half of there function does not exists.

What if they did exist?

Let's build cool stuff and have fun. :)

Posted

With the procedural API, people can start typing SetEntity... and see all the options appear in autocomplete. With the OO API, people have to have the methods they can use memorized. Autocomplete will never work with Lua OO methods because Lua is dynamically typed.

autocomplete.thumb.png.ab999af6d84e49426bd727bd2425506a.png

Let's build cool stuff and have fun. :)

Posted

Reads pretty cool to me, quite enjoy the commands used here

 

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

  • 3 weeks later...
  • Solution
Posted

I decided not to go down this route, and added support for a Lua LSP instead, for autocompletion.

Let's build cool stuff and have fun. :)

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.

×
×
  • Create New...