-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Run: | ||
|
||
``` | ||
godotenv addons install | ||
``` | ||
|
||
Open the project, then restart the editor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Godot; | ||
using ImGuiNET; | ||
using ImGuiGodot; | ||
|
||
[Tool] | ||
public partial class SpriteTool : Sprite2D | ||
{ | ||
private bool _showImGui = false; | ||
|
||
public override void _Ready() | ||
{ | ||
if (Engine.IsEditorHint()) | ||
{ | ||
_showImGui = ImGuiGD.ToolInit(); | ||
var io = ImGui.GetIO(); | ||
io.ConfigFlags |= ImGuiConfigFlags.ViewportsEnable; | ||
io.ConfigViewportsNoAutoMerge = true; | ||
} | ||
} | ||
|
||
public override void _Process(double delta) | ||
{ | ||
if (_showImGui) | ||
{ | ||
ImGui.Begin($"SpriteTool: {Name}"); | ||
float scale = Scale.X; | ||
if (ImGui.DragFloat("scale", ref scale, 0.1f)) | ||
{ | ||
Scale = new(scale, scale); | ||
} | ||
ImGui.End(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Godot.NET.Sdk/4.2.2"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<EnableDynamicLoading>true</EnableDynamicLoading> | ||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="ImGui.NET" Version="1.90.1.1" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2012 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolCSharp", "ToolCSharp.csproj", "{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
ExportDebug|Any CPU = ExportDebug|Any CPU | ||
ExportRelease|Any CPU = ExportRelease|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU | ||
{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU | ||
{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU | ||
{E08468D9-B6AE-4EBA-BE2B-B18B0194FEAF}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"addons": { | ||
"imgui-godot": { | ||
"url": "../../../../addons/imgui-godot", | ||
"source": "symlink" | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://g0surar1un43" | ||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://icon.svg" | ||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 | ||
svg/scale=1.0 | ||
editor/scale_with_editor_scale=false | ||
editor/convert_colors_with_editor_theme=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://ceybxiw6agvb2"] | ||
|
||
[ext_resource type="Texture2D" uid="uid://g0surar1un43" path="res://icon.svg" id="1_vsk0a"] | ||
[ext_resource type="Script" path="res://SpriteTool.cs" id="2_a7b6t"] | ||
|
||
[node name="Node2D" type="Node2D"] | ||
|
||
[node name="Icon" type="Sprite2D" parent="."] | ||
position = Vector2(470, 223) | ||
texture = ExtResource("1_vsk0a") | ||
script = ExtResource("2_a7b6t") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
; Engine configuration file. | ||
; It's best edited using the editor UI and not directly, | ||
; since the parameters that go here are not all obvious. | ||
; | ||
; Format: | ||
; [section] ; section goes between [] | ||
; param=value ; assign values to parameters | ||
|
||
config_version=5 | ||
|
||
[application] | ||
|
||
config/name="ToolCSharp" | ||
run/main_scene="res://main.tscn" | ||
config/features=PackedStringArray("4.2", "C#", "Forward Plus") | ||
config/icon="res://icon.svg" | ||
|
||
[autoload] | ||
|
||
ImGuiRoot="*res://addons/imgui-godot/data/ImGuiRoot.tscn" | ||
|
||
[dotnet] | ||
|
||
project/assembly_name="ToolCSharp" | ||
|
||
[editor_plugins] | ||
|
||
enabled=PackedStringArray("res://addons/imgui-godot/plugin.cfg") |