-
sfernandez
Site Admin
- Posts: 3107
- Joined:
Re: Noob questions about wether some things are possible or
Glad to have been helpful
Re: Noob questions about wether some things are possible or
Just as clarification. That tutorial is intended to be used with the native SDK. We have to adapt it for C#. Meanwhile there is information inside the UnityTutorial about UserControls.Hi,
About the UserControl, i am following this documentation :
Docs/Gui.Core.UserControlTutorial.html
In this documentation the XAML contains the keyword UserControl, if i must use another keyword, could you please tell me which one?
Thanks in advance.
Sorry for the inconvenience.
Re: Noob questions about wether some things are possible or
HI,
I have another problem now.
The following code causes the screen to be black when it's the root of the GUI :
In my GUI, i have several floating panels, and also some draggable items, and I need to be able to detect the mouse events in case a draggable item has been dragged on nothing, that is why i want to set the background of the root to transparent.
The problem appears only when the root is fullscreen. Did i do something wrong or is it a bug?
As a temporar workaround i set the root size to (Screen.width, Screen.height-1).
Edit:
Another question, i am trying to get the mouse coordinate inside a FrameworkElement. The method i found is the following :
It looks like it's not the best method, i would have expected a method in FrameworkElement which directly returns this value. Did i miss it?
Also I think that in WPF, the is a static method on the Mouse class to get the mouse position which takes a relative IInputElement as a parameter. Is there any reason why NoesisGUI differs from WPF on this point?
I have another problem now.
The following code causes the screen to be black when it's the root of the GUI :
Code: Select all
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="Transparent"
>
</Grid>
The problem appears only when the root is fullscreen. Did i do something wrong or is it a bug?
As a temporar workaround i set the root size to (Screen.width, Screen.height-1).
Edit:
Another question, i am trying to get the mouse coordinate inside a FrameworkElement. The method i found is the following :
Code: Select all
Pointi mousePosition = frameworkElement.GetMouse().GetPosition();
Point point = frameworkElement.PointFromScreen(new Point(mousePosition));
Also I think that in WPF, the is a static method on the Mouse class to get the mouse position which takes a relative IInputElement as a parameter. Is there any reason why NoesisGUI differs from WPF on this point?
-
sfernandez
Site Admin
- Posts: 3107
- Joined:
Re: Noob questions about wether some things are possible or
Hi,
Setting the background on the root element is the way we let the user decide if surface must be cleared or not. This only occurs if root element fills the entire screen, that is why setting its size to (Screen.width, Screen.height - 1) disables the clear. An alternative to your solution of setting the size by code is using the margin property:
The grid named "LayoutRoot" will fill the entire screen and receive mouse events.
About the second question, the code you provided is correct and probably if we implement the Mouse.GetPosition(UIElement) function it will have the same code. We don't have the entire WPF API implemented, but we can add the features that could be useful for the user. So, expect this function to be included in the next release
Setting the background on the root element is the way we let the user decide if surface must be cleared or not. This only occurs if root element fills the entire screen, that is why setting its size to (Screen.width, Screen.height - 1) disables the clear. An alternative to your solution of setting the size by code is using the margin property:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="Transparent" Margin="0,0,0,1">
<Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,0,0,-1">
</Grid>
</Grid>
About the second question, the code you provided is correct and probably if we implement the Mouse.GetPosition(UIElement) function it will have the same code. We don't have the entire WPF API implemented, but we can add the features that could be useful for the user. So, expect this function to be included in the next release
Re: Noob questions about wether some things are possible or
I think this is confusing...
Having the property BackGround to Transparent means that control starts with a background set to (0,0,0,0). This is not the same as having the control background being transparent. So the behavior when the control fills the screen is correct although the result when it is partially covered is not.
May be I am totally wrong here but I think that to get the desired behavior you have to eliminate the Background property. That means that the control respect the current background.
Sergio, I think we have a bug here.
Having the property BackGround to Transparent means that control starts with a background set to (0,0,0,0). This is not the same as having the control background being transparent. So the behavior when the control fills the screen is correct although the result when it is partially covered is not.
May be I am totally wrong here but I think that to get the desired behavior you have to eliminate the Background property. That means that the control respect the current background.
Sergio, I think we have a bug here.
Re: Noob questions about wether some things are possible or
Jesus (i think it's your name), I'm not sure i understand what you are saying here. Eliminating the Background does not result in the desired behavior. I need to get the MouseEvents on the full screen, on the root. A control doesn't send MouseEvent if there is no background nor "foreground" (by foreground i mean children controls). To achieve what i want to achieve, i then need to have the background set to transparent on the root.
If you believe that a control should never have a transparent background, could you please indicate me the correct way of doing what i want to do?
I also got another problem with a full screen gui. I narrowed it down to the following code :
(my gui is located in the folder Assets/GUI, as a result, the template path is what is ../NoesisGUI/Themes/NoesisStyle.xaml)
When you interact with the button of this code when it's the root, the gui disappears and Unity enters a lock up state. It does the same with the WindowsStyle, but not with the SimpleSyle nor OrbStyle. As a temporar work around i disabled the Button style in the NoesisStyle.xaml line 293. I think the issue is related to the animation of the control when the control is touching the borders of the screen, however my level of WPF is not advanced enough to give you more information than that.
Edit :
I have another question. From what i understood, NoesisGUI is multithread, so i would like to know if it is guaranteed that the event from NoesisGui are raised on same thread than Unity. This is important because Unity engine methods are not re-entrant.
Thanks in advance.
If you believe that a control should never have a transparent background, could you please indicate me the correct way of doing what i want to do?
I also got another problem with a full screen gui. I narrowed it down to the following code :
Code: Select all
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
>
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../NoesisGUI/Themes/NoesisStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Grid.Resources>
<Button>Button</Button>
</Grid>
When you interact with the button of this code when it's the root, the gui disappears and Unity enters a lock up state. It does the same with the WindowsStyle, but not with the SimpleSyle nor OrbStyle. As a temporar work around i disabled the Button style in the NoesisStyle.xaml line 293. I think the issue is related to the animation of the control when the control is touching the borders of the screen, however my level of WPF is not advanced enough to give you more information than that.
Edit :
I have another question. From what i understood, NoesisGUI is multithread, so i would like to know if it is guaranteed that the event from NoesisGui are raised on same thread than Unity. This is important because Unity engine methods are not re-entrant.
Thanks in advance.
Re: Noob questions about wether some things are possible or
Yes yes. It is a problem on our side. Problem is that we are using the Background property to clear the surface and this is not always correct.Jesus (i think it's your name), I'm not sure i understand what you are saying here. Eliminating the Background does not result in the desired behavior. I need to get the MouseEvents on the full screen, on the root. A control doesn't send MouseEvent if there is no background nor "foreground" (by foreground i mean children controls). To achieve what i want to achieve, i then need to have the background set to transparent on the root.
If you believe that a control should never have a transparent background, could you please indicate me the correct way of doing what i want to do?
It is a bug. Added to the bugtracker.I also got another problem with a full screen gui. I narrowed it down to the following code :(my gui is located in the folder Assets/GUI, as a result, the template path is what is ../NoesisGUI/Themes/NoesisStyle.xaml)Code: Select all<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" > <Grid.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../NoesisGUI/Themes/NoesisStyle.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Grid.Resources> <Button>Button</Button> </Grid>
When you interact with the button of this code when it's the root, the gui disappears and Unity enters a lock up state. It does the same with the WindowsStyle, but not with the SimpleSyle nor OrbStyle. As a temporar work around i disabled the Button style in the NoesisStyle.xaml line 293. I think the issue is related to the animation of the control when the control is touching the borders of the screen, however my level of WPF is not advanced enough to give you more information than that.
Yes, it is guaranteed. Although NoesisGUI uses threads internally the API offered to the client hides that. Callbacks are always invoked in the unity main thread.Edit :
I have another question. From what i understood, NoesisGUI is multithread, so i would like to know if it is guaranteed that the event from NoesisGui are raised on same thread than Unity. This is important because Unity engine methods are not re-entrant.
Thanks in advance.
By the way, it is better if instead if editing a post to ask new questions you create a new one. it seems that the notification system of the forum does not email us when a post is edited. Thanks!
Re: Noob questions about wether some things are possible or
Hi,
Thanks for the answers. Actually i was editing the post on purpose in order not to spam you because otherwise you are going to start hating me
Anyway, i think i will have to create that account on the bug tracker because i guess it's adding load on you if i just post the bugs here.
I would have a question about your policy about the different styles provided with NoesisGUI. Can we reuse part or all of the styles you provided in our games or do we have to recreate or own styles from scratch? I must say i really like the NoesisStyle, it looks cool.
I created a blog about my game and i would like to post some screenshots of it, so i need to know if i have the authorization to do so knowing that my gui is using the NoesisStyle right now except for the button from which i removed the style.
Thanks in advance.
Thanks for the answers. Actually i was editing the post on purpose in order not to spam you because otherwise you are going to start hating me
Anyway, i think i will have to create that account on the bug tracker because i guess it's adding load on you if i just post the bugs here.
I would have a question about your policy about the different styles provided with NoesisGUI. Can we reuse part or all of the styles you provided in our games or do we have to recreate or own styles from scratch? I must say i really like the NoesisStyle, it looks cool.
I created a blog about my game and i would like to post some screenshots of it, so i need to know if i have the authorization to do so knowing that my gui is using the NoesisStyle right now except for the button from which i removed the style.
Thanks in advance.
Re: Noob questions about wether some things are possible or
hehe Getting feedback from users is not a reason to hate, in fact it is the opposite. Open as many threads as you want. I cannot guarantee you fast responses for everything but we try to answer all the posts.
Thanks for the answers. Actually i was editing the post on purpose in order not to spam you because otherwise you are going to start hating me
Yes, absolutely. Our styles are provided as samples. You can reuse, modify them as you like. By the way, NoesisStyle is pending a revision because it can be optimized in several aspects. If you find bugs or improvements do not hesitate to post about it here.I would have a question about your policy about the different styles provided with NoesisGUI. Can we reuse part or all of the styles you provided in our games or do we have to recreate or own styles from scratch? I must say i really like the NoesisStyle, it looks cool.
I created a blog about my game and i would like to post some screenshots of it, so i need to know if i have the authorization to do so knowing that my gui is using the NoesisStyle right now except for the button from which i removed the style.
Is the blog already online? I would love to see it.
Re: Noob questions about wether some things are possible or
Hi,
As you asked for the blog link, here it is. It's only the beginning so there is not much on it yet. I mentioned NoesisGUI on it so I hope you agree with what said.
http://projectminingvessel.blogspot.com/
As you asked for the blog link, here it is. It's only the beginning so there is not much on it yet. I mentioned NoesisGUI on it so I hope you agree with what said.
http://projectminingvessel.blogspot.com/
Who is online
Users browsing this forum: Ahrefs [Bot] and 10 guests