protected override void OnLoad(System.EventArgs e) { Plugin.Register("MarsMiner.Shared.CorePlugin", true, true); Plugin.Register("MarsMiner.Shared.MarsMinerPlugin", true, true); ServerBuilder sb = new ServerBuilder { Name = "Local Server", Password = null, SlotCount = 1 }; myLocalServer = new GameServer(sb); myServerThread = new Thread(myLocalServer.Run); myServerThread.Start(); myLocalClient = new GameClient(); myLocalClient.ConnectLocal(); myClientThread = new Thread(myLocalClient.Run); myClientThread.Start(); mySpriteShader = new SpriteShader(Width, Height); myUIRoot = new UIObject(new Vector2(Width, Height)); myFPSText = new UILabel(Font.Large, new Vector2(4.0f, 4.0f)); myFPSText.Text = "FT: ??ms FPS: ?? MEM: ??"; myUIRoot.AddChild(myFPSText); Mouse.Move += OnMouseMove; Mouse.ButtonUp += OnMouseButtonEvent; Mouse.ButtonDown += OnMouseButtonEvent; /* * myTestWorld = new World(); * * myGeoShader = new GeometryShader( Width, Height ); * myGeoShader.UpdateTileMap( 16 ); * * myGeoRenderers = new List<ChunkRenderer>(); * * myTestWorld.ChunkLoaded += OnChunkEvent; * myTestWorld.ChunkUnloaded += OnChunkEvent; * myTestWorld.ChunkChanged += OnChunkEvent; * * myTestWorld.Generate( 1024, 1024, 4 ); * * myGeoShader.CameraPosition = new Vector3( 0.0f, 1024.0f, 0.0f ); */ GL.ClearColor(new Color4(223, 186, 168, 255)); myFrameTimer.Start(); }
public void Initialize() { var hierarchyRoot = new HierarchyRoot(); var ho1 = new ScriptObject(); var ho2 = new WorldObject(); var ho33 = new UIObject(); var ho3 = new UIObject(); ho3.AddChild("ho3.3", ho33); hierarchyRoot.AddChild("ho1", ho1); hierarchyRoot.AddChild("ho2", ho2); hierarchyRoot.AddChild("ho3", ho3); HierarchyManager.AddHierarchy("test", hierarchyRoot); }
public void AddChild(UIObject child) { myUIRoot.AddChild(child); }
public static void Test(UIObject parent) { UIItemBase item = parent.AddChild <UIItemBase>(null, parent.graphicComponent.transform); item.InvokeAfterAllAssetsLoadDone(() => { item.Show("1", 2); }); }