Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个简单的自定义光标代码,它将光标从我的 Content 文件夹加载到 Texutre2D,然后简单地在 Draw 上绘制它。如何编程图像以在我按住右键单击时更改,然后在我释放右键单击时切换回默认值?
您必须在两个Texture2D变量中加载两个纹理,然后只需检查您Update的右键状态。
Texture2D
Update
if (mouse.RightButton == ButtonState.Pressed) cursorTexture = pressedTexture; else cursorTexture = releasedTexture;
当然cursorTexture是你要画的那个。
cursorTexture