-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Add Opacity to window api #2771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Opacity to window api #2771
Conversation
|
Looks cool, set it to draft for now given the WIP in the title, feel free to change it back to ready for review when you're ready :) |
Change Opacity value type float->double ,because the internal API use the double type
| /// Gets or sets the opacity of the window. | ||
| /// </summary> | ||
| /// <value> 1.0d is fully opaque, 0.0d is fully transparent. value will automatically be clamped to [0.0d, 1.0d] </value> | ||
| /// <remarks> default , if window is null , is regarded as no transparent (1.0d)</remarks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XML comment improments 🙂.
/// <summary>
/// Gets or sets the opacity of the window.
/// </summary>
/// <value>1.0d is fully opaque, 0.0d is fully transparent. The value will automatically be clamped to [0.0d, 1.0d].</value>
/// <remarks>The default value, if the window is null, is considered fully opaque (1.0d).</remarks>
| /// Gets or sets the background color of the window. | ||
| /// </summary> | ||
| /// <value> The background color. </value> | ||
| public abstract Color BackgroundColor { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spacing corrections
/// <summary>
/// Gets or sets the background color of the window.
/// </summary>
/// <value>The background color.</value>
|
Regarding the function of opacity, it seems to be working well, and then the function of designing window transparency. Unfortunately, I have to start working and will continue to develop it next weekend. :) |
|
I'm research how to make Stride support transparent backgrounds, the backgroundColor is same as SplashScreenColor in GameSettingsAsset. The following is my progress..... if we change and we set After several hours of research, I find the key point.... If we want to support transparet, we should change code in file var description = new SwapChainDescription
{
ModeDescription = new ModeDescription(Description.BackBufferWidth, Description.BackBufferHeight,
Description.RefreshRate.ToSharpDX(), (DXGI_Format)swapchainFormat)
, BufferCount = bufferCount
, // TODO: Do we really need this to be configurable by the user?
OutputHandle = handle
, SampleDescription = new SampleDescription((int)Description.MultisampleCount, 0)
, SwapEffect = useFlipModel ? SwapEffect.FlipDiscard : SwapEffect.Discard
, Usage = Usage.BackBuffer | Usage.RenderTargetOutput
, IsWindowed = true
, Flags = GetSwapChainFlags()
,
};
These modifications will bring about significant changes. Perhaps we should have a more detailed discussion |
|
Now , I delete the "BackgroundColor" API , it will change in other PR :) |
|
Looks good, anything else to add @Kryptos-FR ? |
VaclavElias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could review only XML comments. They seem to be ok now. Thanks.
Do I need to submit changes to the API document? :) |
|
The API docs https://doc.stride3d.net/latest/en/api/index.html are generated automatically from the XML comments you added. Once we release new Stride NuGet packages, usually a few days after we deploy Stride Docs https://github.com/stride3d/stride-docs. We use docfx which is a static generator https://doc.stride3d.net/latest/en/contributors/documentation/index.html. So you don't need to do anything regarding API docs. If you would like to update the manual https://doc.stride3d.net/latest/en/manual/index.html, then a PR can be made here https://github.com/stride3d/stride-docs for the page updated or added. In this case I don't think we have any Window manual there. |
Thank you, I think I am more familiar with this process now! 😄 |

PR Details
Add BackgroundColor and Opacity API
Why ADD
Support games like https://store.steampowered.com/app/2666510/Rustys_Retirement/

Related Issue
Types of changes
Checklist