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


C# Manager.register方法代码示例

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


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

示例1: Initialize

        /// <summary>
        /// Allows the app to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            IsMouseVisible = true; // easier for debugging not to "lose" mouse
            SetWindowOnSurface();
            InitializeSurfaceInput();

            // Set the application's orientation based on the orientation at launch
            currentOrientation = ApplicationServices.InitialOrientation;

            // Subscribe to surface window availability events
            ApplicationServices.WindowInteractive += OnWindowInteractive;
            ApplicationServices.WindowNoninteractive += OnWindowNoninteractive;
            ApplicationServices.WindowUnavailable += OnWindowUnavailable;

            // Setup the UI to transform if the UI is rotated.
            // Create a rotation matrix to orient the screen so it is viewed correctly
            // when the user orientation is 180 degress different.
            Matrix inverted = Matrix.CreateRotationZ(MathHelper.ToRadians(180)) *
                       Matrix.CreateTranslation(graphics.GraphicsDevice.Viewport.Width,
                                                 graphics.GraphicsDevice.Viewport.Height,
                                                 0);

            if (currentOrientation == UserOrientation.Top)
            {
                screenTransform = inverted;
            }

            screenWidth = Program.WindowSize.Width;
            screenHeight = Program.WindowSize.Height;

            manager = new Manager();
            manager.Behaviour = new Behaviour(screenWidth, screenHeight);
            manager.Initialize(this, touchTarget, Manager.SelectionMode.NONE);

            batLeft = new Sprite("raquette1", "raquette1");
            batLeft.Initialize(touchTarget);
            batLeft.Weight = 1;
            manager.register(batLeft);

            batRight = new Sprite("raquette2", "raquette2");
            batRight.Initialize(touchTarget);
            batRight.Weight = 1;
            batRight.Position = new Vector2(screenWidth - 140, screenHeight - 455);
            manager.register(batRight);

            bignou = new Sprite("bignou", "paletGame");
            bignou.Initialize(touchTarget);
            bignou.Position = new Vector2((screenWidth - 250) / 2, (screenHeight - 250) / 2);
            manager.register(bignou);

            base.Initialize();
        }
开发者ID:PixelSenseEnib,项目名称:PixelSense,代码行数:60,代码来源:App1.cs


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