elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Documentation incorrect

19 Oct 2017, 11:22

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
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Documentation incorrect

23 Oct 2017, 21:29

This page here refers to the NoesisGUIPanel class, but that is not available anymore.

http://www.noesisengine.com/docs/Gui.Co ... orial.html
Thanks for the feedback. We are revamping all documentation for 2.1, the new code should be:
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);
Also, at the page below the usage of MatrixTransform is incorrect.
transform = (MatrixTransform)rectangle.RenderTransform;

https://www.noesisengine.com/docs/Gui.C ... orial.html
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).
 
elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Re: Documentation incorrect

25 Oct 2017, 05:15

The third line, cannot cast the matrix transform type:
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;
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/
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Documentation incorrect

26 Oct 2017, 18:48

The third line, cannot cast the matrix transform type:
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;
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.
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/
Sure, I agree with you regarding var type. But how is that related to UnityScript?
 
elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Re: Documentation incorrect

27 Oct 2017, 11:29

About the var in C#, I was under the impression that this was not C# but UnityScript :oops:

The third line in the code snippet does compile but it throws the error at runtime. Try it.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Documentation incorrect

27 Oct 2017, 12:27

The third line in the code snippet does compile but it throws the error at runtime. Try it.
Yes, I tried the other day. The sample included in the tutorial works fine (with the changes commented above). What error are you getting?
 
elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Re: Documentation incorrect

27 Oct 2017, 23:52

The error is
InvalidCastException: Cannot cast from source type to destination type.
I will PM you a repo.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Documentation incorrect

28 Oct 2017, 14:52

Please, report in the tracker, it is easier that way for us.

Thanks!
 
elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Re: Documentation incorrect

28 Oct 2017, 16:59

Ok, done. Issue nr 0001171.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Documentation incorrect

30 Oct 2017, 19:09

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:
<Path x:Name="line15805" ....>
  <Path.RenderTransform>
    <MatrixTransform/>
  </Path.RenderTransform>
</Path>

Who is online

Users browsing this forum: Ahrefs [Bot] and 20 guests