我正在尝试使用 nscursor 在我的游戏中使用自定义光标。我使用以下代码
//While initializing openglview
mCustomCursor = [[NSCursor alloc] initWithImage:image hotSpot:NSZeroPoint];
[image release];
[mCustomCursor set]
我在 resetcursorrect 方法中设置光标 rect
- (void)resetCursorRects
{
[self addCursorRect:currentViewPortRect cursor:[NSCursor currentCursor]];
}
出现自定义光标,不一致,有时会切换回系统光标(用于警报),有时会返回,有时不会。这太令人困惑了。我不确定是否应该使用“setOnMouseEntered”、“pop”。使用 nscursor 并动态更改它的标准方法是什么。