SFML / SFML.Net

Official binding of SFML for .Net languages

Home Page:https://www.sfml-dev.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setPosition and move doesn't appear in intelliesense

jordan31bit opened this issue · comments

It seems intelliesense is not showing an option to select setPosition or move. I do have a program that runs and renders my existing sfml code. But it's just these two functions that seem to not exists.

Snippet of error code from Visual Studio22 and sfml .net 2.51
Error CS1061 'RectangleShape' does not contain a definition for 'setPosition' and no accessible extension method 'setPosition' accepting a first argument of type 'RectangleShape' could be found (are you missing a using directive or an assembly reference?) ConsoleApp2 C:\Users\Jordan\source\repos\ConsoleApp2\ConsoleApp2\Program.cs 55 Active

code snippit:

RectangleShape foobar = new RectangleShape();
            SFML.Graphics.RectangleShape taco = new RectangleShape();
            while (window.IsOpen) {
                window.Clear();
                //display the orig array
                for (int i = 0; i < origObjArray.Length; i++) {
                    Console.WriteLine(origObjArray[i]);
                    RenderStates states;
                    `origObjArray[i].setPosition(100f,` 100f);
                    foobar.setPosition(2, 2);

RectangleShape doesn't have either of those functions. Not everything can be translated 1:1 from C++ to C#. Instead C# classes use properties that you can change, so you can set the position by setting the Position property and you can "move" by += the Position property.

Oh ok. Thank you for pointing that out!