string_name.go 761 B

123456789101112131415161718192021222324252627
  1. package gdnative
  2. /*
  3. #include <gdnative/string.h>
  4. #include <gdnative/string_name.h>
  5. #include "gdnative.gen.h"
  6. */
  7. import "C"
  8. // NewStringName returns a StringName wrapper over a Godot C godot_string_name
  9. // initialized with the contents of the given name
  10. func NewStringName(name String) *StringName {
  11. var dest C.godot_string_name
  12. arg1 := name.getBase()
  13. C.go_godot_string_name_new(GDNative.api, &dest, arg1)
  14. return &StringName{base: &dest}
  15. }
  16. // NewStringNameData returns a StringName wrapper over a Godot C godot_string_name
  17. // initialized with the given name
  18. func NewStringNameData(name Char) *StringName {
  19. var dest C.godot_string_name
  20. arg1 := name.getBase()
  21. C.go_godot_string_name_new_data(GDNative.api, &dest, arg1)
  22. return &StringName{base: &dest}
  23. }