SFML community forums

Bindings - other languages => DotNet => Topic started by: SymegPL on January 27, 2013, 06:10:17 pm

Title: [2.0 RC] View bug
Post by: SymegPL on January 27, 2013, 06:10:17 pm
Hello! Sorry for my bad english.

I have problem with View class. When i apply new position, rotation etc. to view it works, but nothing changes on screen. It was only change when i use SetView method.
Exapmle:

window.GetView().Move(new Vector2f(5,5));//nothing changes on the screen

window.SetView(window.GetView().Move(new Vector2f(5,5)));//only now view was applied to the screen

It is bug or not?

Thanks for replies.
Utermiko
Title: Re: [2.0 RC] View bug
Post by: Laurent on January 27, 2013, 06:54:56 pm
Yes, you need to call SetView to change the view. The fact that you can modify GetView() directly is just a limitation of the C# language (there's no const type).
Title: Re: [2.0 RC] View bug
Post by: SymegPL on January 27, 2013, 07:08:38 pm
But classes are passed by reference, not value.

@EDIT I saw on the source. GetView always create new "View" object.
Thank you.