Defold API Snippets for Visual Studio Code

#1

Full api snippets for Defold Engine is available on marketplace.
All Lua and C++ methods, messages, properties and brief descriptions are included.

Marketplace: https://marketplace.visualstudio.com/items?itemName=selimanac.defold-vsc-snippets

selimanac/defold-vsc-snippets - GitHub

Settings

Add .script files to your settings.json

"files.associations": {
        "*.script": "lua",
        "*.gui_script": "lua",
        "*.render_script": "lua",
        "*.editor_script": "lua"
      }

Useful Extensions


Ordered Tabstops

Ordered Tabstops

Message Generation

play_sound => msg.post(receiver, "play_sound", {[delay], [gain]})

model_animation_done => msg.post(receiver, "model_animation_done", {animation_id, playback})

focus

focus

Properties with quotation marks

"scale"

Release Notes

1.2.1

  • API version 1.2.163

1.2.0

LUA and C++ (Defold SDK) APIs are separated. You can use Defold SDK snippets with C++ now.

1.1.7

  • API version 1.2.156

1.1.6

  • API version 1.2.149

1.1.5

  • API version 1.2.147

1.1.4

  • API version 1.2.138
  • Missing functions, methods and properties are added properly.
  • Properties added to the body.

(Sorry for the version numbering, vsce publish minor cause this )

1.0.2

  • Missing functions, methods and properties are added.
  • Args added to the list.

1.0.0

  • Initial release based on API version 1.2.137.

Json Parser

I build this snippet with a simple Python script. It parses all json files from api docs and converts them to single snippet file. It is available here.

31 Likes

Poor IDE font rendering on Win10 in Editor 2
#2

I’m waiting for this one, thx dude! :grin: :heart_eyes:

3 Likes

#3

Love initiatives as this, great job! :smiley:

2 Likes

#4

Ohhhh I guess so much people have been waiting for this. Thanks!

2 Likes

#5

Thank you for this great job!! :joy:

3 Likes

#6

Just found this on the marketplace. Astounding job selimanac

5 Likes

#7

Updated to API 1.2.163
Also, I’m using EmmyLua for some time now. Highly suggested!

6 Likes

#8

EmmyLua is awesome. I also use it but in IntelliJ IDEA.:grinning:

3 Likes

#9

Hi! I just want to thank you for this. I use VS Code for work every day, and I love it. Being able to use it for Defold is amazing. I am however missing one important feature… The ability to do proper debugging. Is there any way of connecting the Defold debugger to VS Code? Thanks!

1 Like

#10

We all missing this feature. As far as I know it is not possible. It maybe possible to trigger build/debug process by calling local Defold URLs but it is not documented and I couldn’t find a good solution with vscode.

2 Likes

#11

We use modebug.lua (you’ll find it in builtins), but I’m sure there are others.
And if it’s anything like python, you can start the debugger server inside your program, probably with a localhost and a certain port, and then connect from it from the debugger.

A quick search found this for instance. I haven’t played with it, but it should surely be possible for you to find something that works.
https://marketplace.visualstudio.com/items?itemName=devCAT.lua-debug

3 Likes

#12

Before Defold had debug tools the suggestion was to use ZeroBrane Studio for debugging so there must be a way.

0 Likes

#13

The Defold debugger uses the same functionality. It boostraps the game with the mobdebug init code so that you can launch with the debugger attached.

0 Likes

#14

I will take a look at that. Thank you.

0 Likes

#15

Aha! Thank you for finding this. I’ll also take a look at it.

0 Likes