Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/146.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SFML C++;SFML.net中的getSize()和sprite.move()_C#_C++_Sfml_Sfml.net - Fatal编程技术网

C# SFML C++;SFML.net中的getSize()和sprite.move()

C# SFML C++;SFML.net中的getSize()和sprite.move(),c#,c++,sfml,sfml.net,C#,C++,Sfml,Sfml.net,我的第一个问题是C++是否: pTexture.getSize().x 等于C#(因为这对我来说不是结果): 第二个问题是关于C++代码(如何在SFLM.NET中写这一行)。 pImage是Sprite,pTexture当然是Texture。在SFML.NET中,属性没有getter/setter方法,因此为了获得/设置大小,您必须: texture.Size = // ... myfunction(texture.Size); 由于没有setter方法,您必须在位置属性上使用+=来模拟移动

我的第一个问题是C++是否:

pTexture.getSize().x
等于C#(因为这对我来说不是结果):

第二个问题是关于C++代码(如何在SFLM.NET中写这一行)。
pImage是Sprite,pTexture当然是Texture。

在SFML.NET中,属性没有getter/setter方法,因此为了获得/设置大小,您必须:

texture.Size = // ...
myfunction(texture.Size);
由于没有setter方法,您必须在
位置
属性上使用
+=
来模拟
移动
方法

pImage.move(0,-1)
texture.Size = // ...
myfunction(texture.Size);