本文整理汇总了C#中CursorType类的典型用法代码示例。如果您正苦于以下问题:C# CursorType类的具体用法?C# CursorType怎么用?C# CursorType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CursorType类属于命名空间,在下文中一共展示了CursorType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBundle
////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------*/
private Bundle GetBundle(CursorType pType, Func<bool> pShowFunc)
{
var bundle = new Bundle();
bundle.CursorType = pType;
bundle.ShowFunc = pShowFunc;
return bundle;
}
示例2: FindNearestItemToCursor
/*--------------------------------------------------------------------------------------------*/
private HoverItemHighlightState FindNearestItemToCursor(CursorType pCursorType,
out HoverItemHighlightState.Highlight? pNearestHigh)
{
float minDist = float.MaxValue;
HoverItemHighlightState nearestItem = null;
pNearestHigh = null;
for ( int i = 0 ; i < vHighStates.Count ; i++ ) {
HoverItemHighlightState item = vHighStates[i];
if ( !item.gameObject.activeInHierarchy || item.IsHighlightPrevented ) {
continue;
}
HoverItemHighlightState.Highlight? high = item.GetHighlight(pCursorType);
if ( high == null || high.Value.Distance >= minDist ) {
continue;
}
minDist = high.Value.Distance;
nearestItem = item;
pNearestHigh = high;
}
return nearestItem;
}
示例3: ResetCursor
public void ResetCursor()
{
if (
currentCursor != CursorType.Grip
&& Manager != null
&&
(
(Manager.GetLeftHandEvent() == InteractionManager.HandEventType.Grip && Manager.IsLeftHandPrimary())
||
(Manager.GetRightHandEvent() == InteractionManager.HandEventType.Grip && !Manager.IsLeftHandPrimary()))
)
{
Cursor.SetCursor(gripCursor, hotSpot,
curMode);
currentCursor = CursorType.Grip;
}
else
if ((Manager.GetLeftHandEvent() != InteractionManager.HandEventType.Grip && Manager.IsLeftHandPrimary())
||
(Manager.GetRightHandEvent() != InteractionManager.HandEventType.Grip && !Manager.IsLeftHandPrimary()))
{
Cursor.SetCursor(handCusor,
hotSpot,
curMode);
currentCursor = CursorType.Hand;
}
}
示例4: GetHighlightDistance
////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------*/
public float GetHighlightDistance(CursorType pCursorType) {
if ( !vHighlightDistanceMap.ContainsKey(pCursorType) ) {
return float.MaxValue;
}
return vHighlightDistanceMap[pCursorType];
}
示例5: GetHighlightProgress
/*--------------------------------------------------------------------------------------------*/
public float GetHighlightProgress(CursorType pCursorType) {
if ( !vHighlightProgressMap.ContainsKey(pCursorType) ) {
return 0;
}
return vHighlightProgressMap[pCursorType];
}
示例6: UIContainer
public UIContainer(Color Colour, Color HighlightColour,
Texture2D Texture = null, Vector2 Position = new Vector2(), Rectangle? SrcRect = null,
int Width = UI_AUTO, int Height = UI_AUTO,
bool IsActive = true, bool IsDraggable = false, CursorType CursorType = UI.CURSOR_DEFAULT,
float MarginLeft = UI_AUTO, float MarginRight = UI_AUTO, float MarginTop = UI_AUTO, float MarginBottom = UI_AUTO,
float opacity = UI_INHERIT, float layerDepth = UI_INHERIT,
bool CentreHorizontal = false, bool CentreVertical = false,
DragAndDropType DragAndDropType = DragAndDropType.None,
object[] DataBinding = null)
: base(Colour, HighlightColour, Texture, Position, SrcRect, Width, Height, IsActive, IsDraggable, CursorType, MarginLeft, MarginRight, MarginTop, MarginBottom, opacity, layerDepth)
{
Children = new List<UIElement>();
this.CentreHorizontal = CentreHorizontal;
this.CentreVertical = CentreVertical;
this._dragAndDropType = DragAndDropType;
if (_dragAndDropType == DragAndDropType.DropElement)
{
this.OnLeftReleased = OnLeftReleasedHandler;
}
this.DataBinding = DataBinding;
if (this.DataBinding == null)
this.DataBinding = new object[0];
}
示例7: GetFingerType
////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------*/
public static Finger.FingerType? GetFingerType(CursorType pCursorType)
{
switch ( pCursorType ) {
case CursorType.LeftThumb:
case CursorType.RightThumb:
return Finger.FingerType.TYPE_THUMB;
case CursorType.LeftIndex:
case CursorType.RightIndex:
return Finger.FingerType.TYPE_INDEX;
case CursorType.LeftMiddle:
case CursorType.RightMiddle:
return Finger.FingerType.TYPE_MIDDLE;
case CursorType.LeftRing:
case CursorType.RightRing:
return Finger.FingerType.TYPE_RING;
case CursorType.LeftPinky:
case CursorType.RightPinky:
return Finger.FingerType.TYPE_PINKY;
case CursorType.LeftPalm:
case CursorType.RightPalm:
return null;
}
throw new Exception("Unhandled CursorType: "+pCursorType);
}
示例8: FromEnum
internal static Cursor FromEnum (CursorType type)
{
switch (type){
case CursorType.Arrow:
return Arrow;
case CursorType.Eraser:
return Eraser;
case CursorType.Hand:
return Hand;
case CursorType.IBeam:
return IBeam;
case CursorType.None:
return None;
case CursorType.SizeNS:
return SizeNS;
case CursorType.SizeWE:
return SizeWE;
case CursorType.Stylus:
return Stylus;
case CursorType.Wait:
return Wait;
case CursorType.SizeNESW:
return SizeNESW;
case CursorType.SizeNWSE:
return SizeNWSE;
case CursorType.Default:
default:
return null;
}
}
示例9: ChangeCursor
public void ChangeCursor(CursorType type)
{
if (_status == CursorGestureStatus.Capturing)
{
// If we're capturing a gesture, we want to keep the current icon on screen
// so we'll save a copy of what it SHOULD be if we weren't capturing to
// apply later.
_backUpCursorType = type;
}
else
{
// The normal type hand should use the top left as the mouse location
// while the others should use the middle of the icon.
if (type != CursorType.Normal)
_offset = _cursorDimensions * .25f;
else
_offset = new Vector2(10, 10);
_activeCursorType = type;
_cursorRect = new Rect(
_cursorTileDimensions.x * (int)_activeCursorType,
_cursorTileDimensions.y * (int)_status,
_cursorTileDimensions.x,
_cursorTileDimensions.y);
}
}
示例10: SetCursor
public static void SetCursor(CursorType type, Form ParentForm)
{
if (ParentForm != null)
{
switch (type)
{
case CursorType.WaitCursor:
ParentForm.Cursor = Cursors.WaitCursor;
break;
case CursorType.Default:
ParentForm.Cursor = Cursors.Default;
break;
case CursorType.Hand:
ParentForm.Cursor = Cursors.Hand;
break;
case CursorType.SizeWE:
ParentForm.Cursor = Cursors.SizeWE;
break;
case CursorType.Cross:
ParentForm.Cursor = Cursors.Cross;
break;
case CursorType.VSplit:
ParentForm.Cursor = Cursors.VSplit;
break;
}
CurrentCursor = type;
}
}
示例11: Cursor
/// <summary>
/// <para>Create a new cursor, based on a pre-defined cursor type.</para>
/// </summary>
///
/// <param name="type">
/// <para>The pre-defined cursor type to use.</para>
/// </param>
public Cursor(CursorType type)
{
this.type = type;
this.source = null;
this.mask = null;
this.cursor = XCursor.Zero;
}
示例12: SetCusorHand1
public void SetCusorHand1()
{
currentCursor = CursorType.Hand1;
Cursor.SetCursor (
handCusor1,
hotSpot,
curMode);
}
示例13: Awake
////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------*/
public void Awake()
{
vSetup = gameObject.GetComponent<HovercursorSetup>();
vFakeItem = new FakeItemState();
vFakeItem.ItemAutoId = 123;
ActiveCursorTypes = new CursorType[0];
}
示例14: GetCursorDataForInput
/*--------------------------------------------------------------------------------------------*/
public IHoverCursorDataForInput GetCursorDataForInput(CursorType pType)
{
if ( !HasCursorData(pType) ) {
throw new Exception("No '"+pType+"' cursor was found.");
}
return vCursorMap[pType];
}
示例15: GetCursor
/*--------------------------------------------------------------------------------------------*/
public override IInputCursor GetCursor(CursorType pType) {
if ( pType != CursorType.Look ) {
throw new Exception("The "+typeof(HovercursorLookInput)+" component does not support "+
"the use of "+typeof(CursorType)+"."+pType+".");
}
return vCursor;
}