{"id":13712289,"url":"https://github.com/godot-zig/godot-zig","last_synced_at":"2025-05-06T21:33:47.614Z","repository":{"id":217145083,"uuid":"743136794","full_name":"godot-zig/godot-zig","owner":"godot-zig","description":"Zig bindings for Godot 4","archived":false,"fork":false,"pushed_at":"2024-02-23T06:47:05.000Z","size":95,"stargazers_count":34,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-02-23T07:38:37.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/godot-zig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-14T12:55:49.000Z","updated_at":"2024-04-15T15:05:30.974Z","dependencies_parsed_at":"2024-02-15T14:25:52.477Z","dependency_job_id":"085d3bf4-f32b-4727-b3c9-f11a2a68bc7c","html_url":"https://github.com/godot-zig/godot-zig","commit_stats":null,"previous_names":["godotzig/godot-zig"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godot-zig%2Fgodot-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godot-zig%2Fgodot-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godot-zig%2Fgodot-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godot-zig%2Fgodot-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godot-zig","download_url":"https://codeload.github.com/godot-zig/godot-zig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772514,"owners_count":21801938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T23:01:16.739Z","updated_at":"2025-05-06T21:33:47.609Z","avatar_url":"https://github.com/godot-zig.png","language":"Zig","funding_links":[],"categories":["Multimedia \u0026 Graphics"],"sub_categories":["Game Development"],"readme":"# godot-zig\n\nA WIP Zig bindings for Godot 4.\nFeatures are being gradually added to meet the needs of a demo game.\nBugs and missing features are expected until a stable version finally released.\nIssue report, feature request and pull request are all welcome.\n\n## Prerequisites\n\n1. zig 0.13\n2. godot 4.3\n\n## Usage:\n\nsee [Examples](https://github.com/godot-zig/godot-zig-examples) for reference.\n\n## Code Sample:\n\n```\nconst std = @import(\"std\");\nconst Godot = @import(\"godot\");\nconst Vec2 = Godot.Vector2;\nconst Self = @This();\nconst Base = Godot.Control;\npub usingnamespace Base;\nbase: Base,\n\nsprite: Godot.Sprite2D,\n\npub fn _enter_tree(self: *Self) void {\n    if (Godot.Engine.getSingleton().isEditorHint()) return;\n\n    var normal_btn = Godot.initButton();\n    self.add_child(normal_btn, false, Godot.Node.INTERNAL_MODE_DISABLED);\n    normal_btn.setPosition(Vec2.new(100, 20), false);\n    normal_btn.setSize(Vec2.new(100, 50), false);\n    normal_btn.setText(\"Press Me\");\n\n    var toggle_btn = Godot.initCheckBox();\n    self.add_child(toggle_btn, false, Godot.Node.INTERNAL_MODE_DISABLED);\n    toggle_btn.setPosition(Vec2.new(320, 20), false);\n    toggle_btn.setSize(Vec2.new(100, 50), false);\n    toggle_btn.setText(\"Toggle Me\");\n\n    Godot.connect(toggle_btn, \"toggled\", self, \"on_toggled\");\n    Godot.connect(normal_btn, \"pressed\", self, \"on_pressed\");\n\n    const resource_loader = Godot.ResourceLoader.getSingleton();\n    const res_name = Godot.String.initFromLatin1Chars(\"res://textures/logo.png\");\n    const texture = resource_loader.load(res_name, \"\", Godot.ResourceLoader.CACHE_MODE_REUSE);\n    if (texture) |tex| {\n        defer _ = Godot.unreference(tex);\n        self.sprite = Godot.initSprite2D();\n        self.sprite.setTexture(tex);\n        self.sprite.setPosition(Vec2.new(400, 300));\n        self.sprite.setScale(Vec2.new(0.6, 0.6));\n        self.addChild(self.sprite, false, Godot.Node.INTERNAL_MODE_DISABLED);\n    }\n}\n\npub fn _exit_tree(self: *Self) void {\n    _ = self;\n}\n\npub fn on_pressed(self: *Self) void {\n    _ = self;\n    std.debug.print(\"on_pressed \\n\", .{});\n}\n\npub fn on_toggled(self: *Self, toggled_on: bool) void {\n    _ = self;\n    std.debug.print(\"on_toggled {any}\\n\", .{toggled_on});\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodot-zig%2Fgodot-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodot-zig%2Fgodot-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodot-zig%2Fgodot-zig/lists"}