简体   繁体   English

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

[英]SFML C++ getSize() and sprite.move() in SFML.net

My first question is if C++: 我的第一个问题是C ++:

pTexture.getSize().x

equals C# (because this is no result for me using this): 等于C#(因为使用此方法对我来说没有结果):

pTexture.Size().X

Second question is about C++ code (how to write in SFML.net this line). 第二个问题是关于C ++代码(此行如何在SFML.net中编写)。

pImage.move(0,-1)

pImage is Sprite and pTexture is Texture of course. 当然pImage是Sprite,pTexture是Texture。

In SFML.NET there is no getter/setter methods for properties, so in order to get/set the size you have to : 在SFML.NET中,没有用于属性的getter / setter方法,因此,为了获取/设置大小,您必须:

texture.Size = // ...
myfunction(texture.Size);

As there is no setter method, you have to use += on the Position property to simulate the move method. 由于没有设置方法,因此必须在Position属性上使用+=来模拟move方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM