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

Transformable.Position must be field

PickGG opened this issue · comments

Снимок
An error occurs when I try to change the individual coordinate of a figure because the position is a property, it needs to be a field.
Error code is CS1612

commented

This is because Position is a struct and returned by a property which are usually preferred. You need to use a local variable of Position to modify individual members.

var rect = new RectangleShape();

var pos = rect.Position;

pos.X = 455.67;
pos.Y += 12424.67;

rect.Position = pos;

Don't forget that SFML.Net is a binding, not a native C# library.