변수 "location"과 동일한 마우스 위치를 설정하려고 시도하지만 "암시 적으로 'void'를 'Microsoft.Xna'로 변환 할 수 없습니다. Framework.Input.MouseState "를 참조하십시오. 내가 알 수있는 한 "위치"는 무효가 아닙니다. Mouse.SetPosition() 할당 된 변수는 void로 간주됩니다.
class Player
{
private Texture2D texture;
private static int textureSize = 20;
private static int screenWidth = Game1.Instance.GraphicsDevice.Viewport.Width;
private static int screenHeight = Game1.Instance.GraphicsDevice.Viewport.Height;
private static int halfTexture = (int)(textureSize * (screenHeight/(double)textureSize))/2;
private Vector2 location;
private Rectangle destination;
private float speed;
private MouseState mouse;
public Player(Texture2D texture)
{
this.texture = texture;
this.location = new Vector2(screenWidth/2 - halfTexture, screenHeight * 3/4 - halfTexture);
this.destination = new Rectangle((int)location.X, (int)location.Y, textureSize, textureSize);
this.mouse = Mouse.SetPosition((int)location.X, (int)location.Y); // the error is here
}
는 그래서 여기에 무슨 내가 그것을 어떻게 해결합니까 : 여기 인해이 작품을 만들려고 노력에 조금 어수선 코드는 무엇입니까?
이 경우'location.x'와'location.y'의 값은 무엇입니까? –
X는 390이어야하고 Y는 440이어야합니다. – Firearrow5235