当前位置: 首页>>代码示例>>C#>>正文


C# Snapshot.CreateInteractor方法代码示例

本文整理汇总了C#中Snapshot.CreateInteractor方法的典型用法代码示例。如果您正苦于以下问题:C# Snapshot.CreateInteractor方法的具体用法?C# Snapshot.CreateInteractor怎么用?C# Snapshot.CreateInteractor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Snapshot的用法示例。


在下文中一共展示了Snapshot.CreateInteractor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToSnapshot

    /// <summary>
    /// Adds the interactor to the given snapshot.
    /// </summary>
    /// <param name="snapshot">Interaction snapshot.</param>
    /// <param name="windowId">ID of the game window.</param>
    /// <param name="viewportPosition">Position of the game window in screen coordinates.</param>
    public void AddToSnapshot(Snapshot snapshot, string windowId, Vector2 viewportPosition, Vector2 viewportPixelsPerDesktopPixel)
    {
        using (var interactor = snapshot.CreateInteractor(_id, _parentId, windowId))
        {
            using (var bounds = interactor.CreateBounds(BoundsType.Rectangular))
            {
                // Location.rect is in GUI space.
                bounds.SetRectangularData(
                    viewportPosition.x + Location.rect.x / viewportPixelsPerDesktopPixel.x,
                    viewportPosition.y + Location.rect.y / viewportPixelsPerDesktopPixel.y,
                    Location.rect.width / viewportPixelsPerDesktopPixel.x,
                    Location.rect.height / viewportPixelsPerDesktopPixel.y);
            }

            interactor.Z = Location.relativeZ;

            if (Mask != null &&
                Mask.Type != EyeXMaskType.None)
            {
                var mask = interactor.CreateMask(MaskType.Default, Mask.Size, Mask.Size, Mask.MaskData);
                mask.Dispose();
            }

            foreach (var behavior in EyeXBehaviors)
            {
                behavior.AssignBehavior(interactor);
            }
        }
    }
开发者ID:estubmo,项目名称:EscapeTheCircle,代码行数:35,代码来源:EyeXInteractor.cs

示例2: AddToSnapshot

        /// <summary>
        /// Creates an EyeX interactor from the properties and behaviors in
        /// this WpfInteractor, and adds it to the provided snapshot.
        /// </summary>
        /// <param name="snapshot">The <see cref="Snapshot"/> to 
        /// add the interactor to.</param>
        public void AddToSnapshot(Snapshot snapshot)
        {
            if (!IsQueryable)
            {
                return;
            }

            using (var interactor = snapshot.CreateInteractor(Id, ParentId, WindowId.ToString()))
            {
                var boundsRect = GetElementBoundsInScreenCoordinates(Element);
                using (var bounds = interactor.CreateBounds(BoundsType.Rectangular))
                {
                    bounds.SetRectangularData(boundsRect.Left, boundsRect.Top, boundsRect.Width, boundsRect.Height);
                }

                interactor.Z = Z;

                foreach (var behavior in _behaviors)
                {
                    behavior.AssignBehavior(interactor);
                }
            }
        }
开发者ID:osin-vladimir,项目名称:EyeX,代码行数:29,代码来源:WpfInteractor.cs

示例3: AddToSnapshot

        /// <summary>
        /// Adds the interactor to a given snapshot.
        /// </summary>
        /// <param name="snapshot">The snapshot to add the interactor to.</param>
        public void AddToSnapshot(Snapshot snapshot)
        {
            using (var interactor = snapshot.CreateInteractor(Id, ParentId, WindowId))
            {
                using (var bounds = interactor.CreateBounds(BoundsType.Rectangular))
                {
                    var screenTopLeft = Control.PointToScreen(Point.Empty);
                    var screenBottomRight = Control.PointToScreen(new Point(Control.Size.Width, Control.Size.Height));
                    bounds.SetRectangularData(screenTopLeft.X, screenTopLeft.Y, screenBottomRight.X - screenTopLeft.X, screenBottomRight.Y - screenTopLeft.Y);
                }

                interactor.Z = Z;

                foreach (var behavior in _behaviors)
                {
                    behavior.AssignBehavior(interactor);
                }
            }
        }
开发者ID:osin-vladimir,项目名称:EyeX,代码行数:23,代码来源:FormsInteractor.cs


注:本文中的Snapshot.CreateInteractor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。