godotjs / godotjs/javascript

Missing gdscript functions

Open
#56 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
1.1k
Forks
80
PR merge metrics
No merged PRs in 30d

Description

I notice we're missing some print functions that are in gdscript. Namely [prints](https://docs.godotengine.org/en/stable/classes/class_@gdscript.html#class-gdscript-method-prints), [printt](https://docs.godotengine.org/en/stable/classes/class_@gdscript.html#class-gdscript-method-printt), [print_debug](https://docs.godotengine.org/en/stable/classes/class_@gdscript.html#class-gdscript-method-print-debug), and [print-stack](https://docs.godotengine.org/en/stable/classes/class_@gdscript.html#class-gdscript-method-print-stack).

When writing gdscript I use `prints` in every situation (as it inserts spaces between arguments, just like `console.log` in JavaScript), so I noticed it quickly when trying this project.

Also I'm not sure that `print` is working as expected. It is supposed to accept and print any number of arguments, but in my testing it only prints the first:

```typescript
// this prints: "a"
godot.print("a", "b", "c")
```

The typings for `print` seem correct though:

```typescript
function godot.print(...args: any[]): void
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the binding behind godot.print and compare its argument handling with the GDScript functions linked in the issue. Check how print currently handles multiple arguments, then trace the corresponding API entry points for prints, printt, print_debug, and print-stack. Done means the four functions are available and print accepts all supplied arguments as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot, javascript, typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.