Documentation incorrect
This page here refers to the NoesisGUIPanel class, but that is not available anymore.
http://www.noesisengine.com/docs/Gui.Co ... orial.html
Also, at the page below the usage of MatrixTransform is incorrect.
transform = (MatrixTransform)rectangle.RenderTransform;
https://www.noesisengine.com/docs/Gui.C ... orial.html
http://www.noesisengine.com/docs/Gui.Co ... orial.html
Also, at the page below the usage of MatrixTransform is incorrect.
transform = (MatrixTransform)rectangle.RenderTransform;
https://www.noesisengine.com/docs/Gui.C ... orial.html
Re: Documentation incorrect
Thanks for the feedback. We are revamping all documentation for 2.1, the new code should be:This page here refers to the NoesisGUIPanel class, but that is not available anymore.
http://www.noesisengine.com/docs/Gui.Co ... orial.html
Code: Select all
Grid grid = (Grid)GetComponent<NoesisView>().Content;
Texture2D texture = (Texture2D)Resources.Load("Noesis");
TextureSource source = new TextureSource(texture);
Image image = (Image)grid.FindName("image");
image.SetSource(source);
Sorry, what problem are you observing here? I just tested the code in that sample and it is working fine (after fixing the same problem as above with GetComponent).Also, at the page below the usage of MatrixTransform is incorrect.
transform = (MatrixTransform)rectangle.RenderTransform;
https://www.noesisengine.com/docs/Gui.C ... orial.html
Re: Documentation incorrect
The third line, cannot cast the matrix transform type:
Also, may I suggest you do not use the var type in C# code? It makes it hard to figure out what types are used. Besides, UnityScript will be deprecated in the future anyway:
https://blogs.unity3d.com/2017/08/11/un ... he-sunset/
Code: Select all
NoesisView panel = GetComponent<NoesisView>();
Path rect = (Path)panel.Content.FindName("squaretest");
MatrixTransform pitchTransform = (MatrixTransform)rect.RenderTransform;
Transform2 pitchMatrix = pitchTransform.Matrix;
pitchMatrix.Translate(0, 10f);
pitchTransform.Matrix = pitchMatrix;
https://blogs.unity3d.com/2017/08/11/un ... he-sunset/
Re: Documentation incorrect
Sorry, I am not following here. The third line should compile, it is exactly the same code we have in our tutorial. Please, paste the exact error you are having.The third line, cannot cast the matrix transform type:
Code: Select allNoesisView panel = GetComponent<NoesisView>(); Path rect = (Path)panel.Content.FindName("squaretest"); MatrixTransform pitchTransform = (MatrixTransform)rect.RenderTransform; Transform2 pitchMatrix = pitchTransform.Matrix; pitchMatrix.Translate(0, 10f); pitchTransform.Matrix = pitchMatrix;
Sure, I agree with you regarding var type. But how is that related to UnityScript?Also, may I suggest you do not use the var type in C# code? It makes it hard to figure out what types are used. Besides, UnityScript will be deprecated in the future anyway:
https://blogs.unity3d.com/2017/08/11/un ... he-sunset/
Re: Documentation incorrect
About the var in C#, I was under the impression that this was not C# but UnityScript
The third line in the code snippet does compile but it throws the error at runtime. Try it.
The third line in the code snippet does compile but it throws the error at runtime. Try it.
Re: Documentation incorrect
Yes, I tried the other day. The sample included in the tutorial works fine (with the changes commented above). What error are you getting?The third line in the code snippet does compile but it throws the error at runtime. Try it.
Re: Documentation incorrect
The error is
I will PM you a repo.InvalidCastException: Cannot cast from source type to destination type.
Re: Documentation incorrect
Please, report in the tracker, it is easier that way for us.
Thanks!
Thanks!
Re: Documentation incorrect
From the tracker:
The error indicates that the transform stored in the element is not a MatrixTransform.
That is because the specified element "line15805" in the attached sample doesn't define a RenderTransform, and by default it returns an Identity Transform. In fact that transform is frozen, so you won't be able to modify it. So I suggest if you want to play with the RenderTransform of an element to explicitly set one.
For example, if you are going to translate only the element, you can set a TranslateTransform and modify its X and Y properties. If you need to rotate the element, then use a RotateTransform. But if you need complex transformations, set a MatrixTransform:
Code: Select all<Path x:Name="line15805" ....> <Path.RenderTransform> <MatrixTransform/> </Path.RenderTransform> </Path>
Who is online
Users browsing this forum: Bing [Bot] and 93 guests