English 中文(简体)
• 如何在XNA中确定 cur的位置
原标题:How to set the cursor s position in c# XNA

因此,我对XNA很陌生,但我知道如何制造一个照相物体和控制。 我想对我的照相机进行更多的直观控制,因为当 cur子用以下代码击中屏幕的边缘时,轮挡。 而这又是无动于衷的。

我想能够把 cur子的位置重新定位到屏幕的中间,我如何能够这样做?

MouseState mouseState = Mouse.GetState();

yaw -= (mouseState.X - oldx) / 600.0f;
pitch -= (mouseState.Y - oldy) / 600.0f;

oldx = mouseState.X;
oldy = mouseState.Y;
最佳回答

在屏幕中确定模拟位置:

Mouse.SetPosition(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);

You can see an example of this at Riemers XNA Tutorials.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签