Coder Social home page Coder Social logo

ly774508966 / appwindowutility Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sator-imaging/appwindowutility

0.0 1.0 0.0 32 KB

This utility is for Unity to configure application window style. With this utility, you can make your application window transparent, frameless and more.

Home Page: https://qiita.com/sator_imaging/items/e1cb54861b17bbac36ff

License: MIT License

C# 100.00%

appwindowutility's Introduction

App Window Utility

This utility is for Unity to configure application window style. With this utility, you can make your application window transparent, frameless and more.

Features

Tested with Unity 2020.3 LTS and HDRP 10.3.2 on Windows 10 64-bit.

Transparent Window

bool AppWindowUtility.Transparent { get; set; }

This will make application window transparent. In other words, you can see behind through application window.

Transparency is based on Unity's rendering result. So that you need to set camera background to Solid Color with alpha is set to zero.

NOTE: If you use High-Definition Render Pipeline (HDRP) or something based on Scriptable Render Pipeline (SRP), Color Frame Buffer setting needs to be set to RGB 16bit (or 8bit if available). Unity's default is RGB 10bit that Operating System doesn't support.

Window Opacity

AppWindowUtility.SetWindowOpacity(byte opacity)

This will set overall window opacity. It works with see-thru window.

WindowGrabber Component

With Transparent enabled, window has no title bar so that you need a way to move window.

WindowGrabber adds an ability to move window by dragging any area of application window. To add this feature, create empty GameObject and attach WindowGrabber component.

You can still use uGUI controls if WindowGrabber is used.

Full Screen Mode

bool AppWindowUtility.FullScreen { get; set; }

This will make window full screen or not.

NOTE: Use this instead of Unity's built-in UnityEngine.Screen.SetResolution(width, height, isFullScreen) and UnityEngine.Screen.fullScreen to work better with App Window Utility.

Always on Top

bool AppWindowUtility.AlwaysOnTop { get; set; }

This will make application window stay on top of other windows while another application has focus.

Click-Thru Mode

bool AppWindowUtility.ClickThrough { get; set; }

This make application window non-clickable.

NOTE: You must implement a way to disable this feature not using mouse click. If not implemented, you cannot touch your application anymore.

Window Frame Visibility

bool AppWindowUtility.FrameVisibility { get; set; }

This will set window frame visibile or invisible.

NOTE: When enable transparent window, window frame will be automatically hidden.

Color-Keying Window

AppWindowUtility.SetKeyingColor(byte red, byte green, byte blue)

This will Keying specified color from application window. It's strongly recommended to use AppWindowUtility.Transparent instead of this.

Additive Composition Mode

On Windows, applying AppWindowUtility.SetKeyingColor(0, 0, 0) and then AppWindowUtility.Transparent = true will change window composition mode to "Additive".

NOTE: This behaviour could be a bug of Windows.

Important Notes

Player Settings

Use DXGI Flip Model Swapchain for D3D11 must be turned off to work correctly.

If App Window Utility doesn't work as you expected, see Player Settings below for reference.

Using with High-Definition Render Pipeline (HDRP)

Color Buffer Format must be RGB 16bit (or something supported on Host OS) to work correctly. Other renderer based on Scriptable Render Pipeline (SRP) needs setting like this too.

Transparent and Frame Visibility

If you apply Transparent = true and then FrameVisibility = true, it will remove background filling from application window. Result is below, as you can see, background is filled with window frame color.

Copyright

Copyright © 2021 Sator Imaging, all rights reserved.

License

See LICENSE text included.

appwindowutility's People

Contributors

sator-imaging avatar

Watchers

 avatar

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.