Code Monkey home page Code Monkey logo

godot-clickthrough's Introduction

Godot-Clickthrough

Example implementation of a window with "transparent" properties made in the Godot Engine using C#

Using Godot 4.2.1 C# This is a basic implementation of window transparency with click-through ability using simply the viewport transparent pixels C# only, using Windows API calls (not tested for other systems)

I am currently working on a GDExtension adaptation so GDScript-only users can access to this feature more easily!

(And perhaps Linux support if I manage to)

Known issues

On newer graphic drivers, the window transparency may not work correctly: Clickthrough still functions, but the window is black and not transparent

After some tinkering I managed to find some solutions (yet not sure on why this problem occurs in the first place)

  • Change rendering method to Compatibility or
  • Disable VSync in Project Settings > Display > Window > V-Sync Mode: "Disabled", if you need a fps cap consider using Project Settings > Application > Run > Max FPS instead

godot-clickthrough's People

Contributors

kitzugg avatar

Stargazers

Everton Júnior avatar Russell Matney avatar  avatar peter avatar  avatar  avatar  avatar Charlie Burnham avatar

Watchers

 avatar  avatar

Forkers

sleeplessman

godot-clickthrough's Issues

Errors when mouse moves to another monitor.

Your solution is working great for me, thanks!

Just wanted to post (in case someone searches this error) that if you move the mouse to a second monitor where the application isn't, you will get errors:

I don't yet know if it will cause issues with the program working or not, but I assume not.

E 0:00:04:0735 NativeCalls.cs:5102 @ Godot.Color Godot.NativeCalls.godot_icall_2_573(nint, nint, int, int): Index p_x = -737 is out of bounds (width = 1936).
<C++ Source> core/io/image.cpp:3279 @ get_pixel()
NativeCalls.cs:5102 @ Godot.Color Godot.NativeCalls.godot_icall_2_573(nint, nint, int, int)
Image.cs:996 @ Godot.Color Godot.Image.GetPixel(int, int)
MouseDetection.cs:49 @ void MouseDetection.DetectPassthrough()
MouseDetection.cs:22 @ void MouseDetection._PhysicsProcess(double)
Node.cs:2105 @ bool Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
MouseDetection_ScriptMethods.generated.cs:68 @ bool MouseDetection.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
CSharpInstanceBridge.cs:24 @ Godot.NativeInterop.godot_bool Godot.Bridge.CSharpInstanceBridge.Call(nint, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, int, Godot.NativeInterop.godot_variant_call_error*, Godot.NativeInterop.godot_variant*)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.