public override void onAddedToEntity() { // prep IMGUI for use IMGUI.init(Graphics.instance.bitmapFont); _miner = entity.scene.findObjectOfType <BehaviorTreeMiner>(); _utilityMiner = entity.scene.findObjectOfType <UtilityMiner>(); _goapMiner = entity.scene.findObjectOfType <GOAPMiner>(); }
protected override void Initialize() { base.Initialize(); Window.AllowUserResizing = true; // prep IMGUI for use IMGUI.init(Graphics.instance.bitmapFont); scene = Scenes.sceneOne(); }
void Awake() { Application.targetFrameRate = -1;//固定fps SP = this; foundGems = 0; gameState = GameState.playing; totalGems = GameObject.FindGameObjectsWithTag("Picker").Length; Time.timeScale = 1.0f; }
protected void Render() { GL.Viewport(0, 0, Width, Height); GL.Enable(EnableCap.DepthTest); GL.ClearColor(0.1f, 0.3f, 0.4f, 0.0f); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); DrawCommandRenderer.DrawText(0.0f, 0.0f, "hahahahahahha"); //DrawCommandRenderer.DrawRect(0.0f, 0.0f, 150.0f, 50.0f,Color4.Yellow); IMGUI.Render(); }
protected override void LoadContent() { _s = new SpriteBatch(GraphicsDevice); _fontSystem = FontSystemFactory.Create(GraphicsDevice, 2048, 2048); _fontSystem.AddFont(TitleContainer.OpenStream($"{Content.RootDirectory}/SourceCodePro-Medium.ttf")); GuiHelper.Setup(this, _fontSystem); _ui = new IMGUI(); }
public override void Update() { IMGUI.Begin(font); IMGUI.BeginWindow("NASTY-ENGINE", Engine.GameWidth / 2 - 70, Engine.GameHeight / 2); //TODO: fill out these scenes if (IMGUI.Button("IMGUI", 140)) { toggle = !toggle; } IMGUI.Separator(); if (IMGUI.Button("COLLISIONS", 140)) { } IMGUI.Separator(); if (IMGUI.Button("INPUT", 140)) { } IMGUI.Separator(); if (IMGUI.Button("TILEMAP", 140)) { } IMGUI.Separator(); IMGUI.EndWindow(); if (toggle) { IMGUI.BeginWindow("IMGUI", Engine.GameWidth / 2 - 70 + 180, Engine.GameHeight / 2); if (IMGUI.Button("BUTTON", 140)) { } IMGUI.TextField("TEXT-FIELD", ref text); IMGUI.EndWindow(); } IMGUI.End(); base.Update(); }
protected override void OnUpdateFrame(FrameEventArgs e) { if (IMGUI.CheckUpdate()) { IMGUI.ProcessInput(this.X, this.Y); //if (IMGUI.Button()) { } //IMGUI.AddRect(0.0f, 0.0f, 150.0f, 50.0f,Color4.Yellow,true); IMGUI.End(); } Console.WriteLine("x is" + OpenTK.Input.Mouse.GetCursorState().X); Console.WriteLine("y is" + OpenTK.Input.Mouse.GetCursorState().Y); }
public override void Init(GraphicsDeviceManager _graphics, ContentManager Content, GraphicsDevice GraphicsDevice, ScreenManager screenManager, Game game) { this.game = game; FPS = new Vector2(10, 10); font = Content.Load <SpriteFont>("File"); FontSystem fontSystem = FontSystemFactory.Create(GraphicsDevice, 2048, 2048); fontSystem.AddFont(TitleContainer.OpenStream($"{Content.RootDirectory}/Monaco-1.ttf")); GuiHelper.Setup(game, fontSystem); _ui = new IMGUI(); Text = new Vector2(30, 30); base.Init(_graphics, Content, GraphicsDevice, screenManager, game); }
protected override void LoadContent() { _s = new SpriteBatch(GraphicsDevice); FontSystem fontSystem = FontSystemFactory.Create(GraphicsDevice, 2048, 2048); fontSystem.AddFont(TitleContainer.OpenStream($"{Content.RootDirectory}/source-code-pro-medium.ttf")); GuiHelper.Setup(this, fontSystem); _ui = new IMGUI(); GuiHelper.CurrentIMGUI = _ui; var texture = Content.Load <Texture2D>("apos"); _apos = new TextureRegion2D(texture, 0, 0, texture.Width, texture.Height); }
public Editor(World world, GraphicsDevice graphicsDevice) { _world = world; _aabbTree = _world.AABBTree; _entities = _world.Entities; _historyHandler = new HistoryHandler(null); _selectedEntities = new AABBTree <Entity>(); _selection = new RectEdit(); _edit = new RectEdit(); _ui = new IMGUI(); _pathEditor = new PathEditor(_world.Woods); WindowResize(graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height); }
public override void render(Graphics graphics, Camera camera) { IMGUI.beginWindow((Screen.width / 2) - 100, (Screen.height / 2) - 90, 200, 180); if (IMGUI.button("BT: LowerPriority Abort Tree")) { Debug.log("------ Enabled Behavior Tree LowerPriority Abort ------"); disableAllAI(); _miner.buildLowerPriorityAbortTree(); _miner.setEnabled(true); } if (IMGUI.button("BT: Self Abort Tree")) { Debug.log("------ Enabled Behavior Tree Self Abort ------"); disableAllAI(); _miner.buildSelfAbortTree(); _miner.setEnabled(true); } if (IMGUI.button("Utility AI")) { Debug.log("------ Enabled Utility AI ------"); disableAllAI(); _utilityMiner.setEnabled(true); } if (IMGUI.button("GOAP")) { Debug.log("------ Enabled GOAP ------"); disableAllAI(); _goapMiner.setEnabled(true); } IMGUI.space(20); if (IMGUI.button("Stop AI")) { disableAllAI(); } IMGUI.endWindow(); }
protected override void LoadContent() { SpriteBatch = new SpriteBatch(GraphicsDevice); //Create the different managers _chargeBar = new ChargeBar(this, SpriteBatch, Graphics, new Vector2((1900 * Window.ClientBounds.Width) / 1980, (1100 * Window.ClientBounds.Height) / 1080)); _sound = new SoundManager(this); _manager = new GameManager(this); _manager.AddPlayer(new Player(this, "jojo", "ball_red", new Vector3(0, -20, 0))); _manager.LoadGame(1); //Create cameras responsible of following the ball CameraClassic = new Camera(Vector3.Zero, 0, 0, BEPUutilities.Matrix.CreatePerspectiveFieldOfViewRH(MathHelper.PiOver4, Graphics.PreferredBackBufferWidth / (float)Graphics.PreferredBackBufferHeight, .1f, 10000)); Camera = new ChaseCameraControlScheme(_manager.Space.Entities[0], new Vector3(0, 7, 0), false, 50f, CameraClassic, this); //Adding event for sound managing _manager.MainPlayer.Ball.Form.CollisionInformation.Events.ContactCreated += Events_ContactCreated; _manager.MainPlayer.Ball.Form.CollisionInformation.Events.DetectingInitialCollision += Events_DetectingInitialCollision; _manager.MainPlayer.Ball.Form.CollisionInformation.Events.CollisionEnded += Events_CollisionEnded; //Loading font and background for HUD FontSystem fontSystem = FontSystemFactory.Create(GraphicsDevice, 2048, 2048); fontSystem.AddFont(TitleContainer.OpenStream($"{Content.RootDirectory}/font-file.ttf")); _background = Content.Load <Texture2D>("Sprites/background_menu"); //Setup the HUD GuiHelper.Setup(this, fontSystem); _hudFont = Content.Load <SpriteFont>("Hud"); _ui = new IMGUI(); }
protected override void Draw(GameTime gameTime) { base.Draw(gameTime); if (!_renderIMGUI) { return; } IMGUI.beginWindow(GraphicsDevice.Viewport.Width - 150, 0, 150, Screen.height); debugRenderEnabled = IMGUI.toggle("Debug Render", debugRenderEnabled); if (IMGUI.button("Destructable Map")) { scene = new DestructableMapScene(); } if (IMGUI.button("Scene 1 ShowAll")) { scene = Scenes.sceneOne(true); } if (IMGUI.button("Scene 1 NoBorder")) { scene = Scenes.sceneOne(false); } if (IMGUI.button("Scene 1 Pixel Bloom")) { Core.startSceneTransition(new SquaresTransition(() => Scenes.sceneOneBloom())); } if (IMGUI.button("Zelda Tilemap")) { Core.startSceneTransition(new WindTransition(() => Scenes.zeldaTilemap())); } if (IMGUI.button("Scene 2")) { var maskTexture = Core.contentManager.Load <Texture2D>("Images/bowser-mask"); Core.startSceneTransition(new ImageMaskTransition(() => Scenes.sceneTwo(), maskTexture)); } if (IMGUI.button("Scene 3 Box")) { Core.startSceneTransition(new TransformTransition(() => Scenes.sceneThree(true), TransformTransition.TransformTransitionType.SlideDown)); } if (IMGUI.button("Scene 3 Circle")) { Core.startSceneTransition(new TransformTransition(() => Scenes.sceneThree(false))); } if (IMGUI.button("Lights")) { Core.startSceneTransition(new TransformTransition(() => Scenes.lightsScene())); } if (IMGUI.button("Scene 4")) { Core.startSceneTransition(new FadeTransition(() => Scenes.sceneFour())); } if (IMGUI.button("Scene 5")) { Core.startSceneTransition(new CrossFadeTransition(() => Scenes.sceneFive())); } if (IMGUI.button("Overlap2D Scene")) { Core.startSceneTransition(new WindTransition(() => Scenes.sceneOverlap2D())); } if (IMGUI.button("Processor Scene")) { scene = Scenes.processorScene(); } if (IMGUI.button("Transform Scene")) { scene = Scene.createWithDefaultRenderer <TransformScene>(); } if (IMGUI.button("Rigidbody Scene")) { scene = Scene.createWithDefaultRenderer <RigidbodyScene>(); } if (IMGUI.button("SpringGrid Scene")) { scene = Scene.createWithDefaultRenderer <SpringGridScene>(); } if (IMGUI.button("Stencil Test Scene")) { scene = Scene.createWithDefaultRenderer <StencilTestScene>(); } IMGUI.space(15); if (IMGUI.button("Grab Screenshot")) { scene.requestScreenshot(tex => { var path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "screenshot.png"); using (var stream = new System.IO.FileStream(path, System.IO.FileMode.OpenOrCreate)) tex.SaveAsPng(stream, tex.Width, tex.Height); tex.Dispose(); }); } IMGUI.endWindow(); }
public override void RenderEnd() { base.RenderEnd(); IMGUI.Render(); }
protected override void OnLoad(EventArgs e) { CursorVisible = true; IMGUI.Init(); }