GlueView.EditorLogic.Initialize C# (CSharp) Method

Initialize() public static method

public static Initialize ( ) : void
return void
        public static void Initialize()
        {
            // This may be annoying but it's very useful
            FlickeringOn = true;

            GluxManager.GluxLoaded += new Action(OnGluxLoaded);
            GluxManager.ElementRemoved += new Action<FlatRedBall.Glue.SaveClasses.IElement>(OnElementRemoved);
            GluxManager.BeforeElementLoaded += new Action<FlatRedBall.Glue.SaveClasses.IElement>(BeforeElementLoaded);
            GluxManager.ElementHighlighted += new Action<ElementRuntime>(OnElementHighlighted);
            GluxManager.ScriptReceived += GlueViewCommands.Self.ScriptingCommands.ApplyScript;

            FacadeContainer.Self.GlueState = GlueViewState.Self;
            FacadeContainer.Self.ProjectValues = GlueViewState.Self;

            TypeManager.LoadAdditionalTypes(Assembly.GetExecutingAssembly(), "FlatRedBall.Glue.StateInterpolation.");
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Allows the game 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()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            InitializeIoc();

            this.TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);

            mToolForm       = new ToolForm();
            mToolForm.Owner = (Form)(Form.FromHandle(FlatRedBallServices.WindowHandle));
            mToolForm.ItemCollapsedOrExpanded += HandleToolFormItemCollapsedOrExpanded;
            Plugin.PluginManager.Initialize();

            IsMouseVisible = true;

            IsFixedTimeStep = false;

            GuiData.Initialize();

            RegisterAdditionalAssemblies();

            AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory);

            #region Set up resizing

            mFormMethods = new FormMethods(0, 0, 0, 0);

            #endregion

            SpriteManager.Camera.BackgroundColor = Color.Gray;
            FlatRedBall.Math.Geometry.Polygon.TolerateEmptyPolygons = true;
            ExposedVariableManager.Initialize();

            try
            {
                RemotingServer.SetupPort(8686);
                RemotingServer.SetupInterface <FlatRedBall.Glue.SelectionInterface>();
                RemotingServer.SetupInterface <RegisterInterface>();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("GlueView could not start, please make sure GlueView is not already running on your computer \n \n Exception: \n" + e.ToString());
                FlatRedBall.FlatRedBallServices.Game.Exit();
            }

            mToolForm.Show();

            GluxManager.ContentManagerName = "GlueView";


            EditorLogic.Initialize();

            CommandLineManager.Self.ProcessCommandLineArgs(this.mToolForm);

            mainForm         = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form;
            mainForm.Resize += HandleResize;
            base.Initialize();
        }