protected override void processEvent(GuiEvent guiEvent, Game game, bool inGui) { if (guiEvent.type == GuiEventType.mousePressed) { if (inGui) { this.holder.focus = this; } } else if (guiEvent.type == GuiEventType.keyTyped) { if(inGui){ if (this.holder.focus == this) { } } } }
protected override void processEvent(GuiEvent guiEvent, Game game, bool inGui) { if(guiEvent.type == GuiEventType.mousePressed){ if(inGui){ function.Invoke(this, game); } } else if (guiEvent.type == GuiEventType.mouseMoved) { if (inGui && !buttonDown) { buttonDown = true; dirty = true; } else if (!inGui && buttonDown) { buttonDown = false; dirty = true; } } }
protected abstract void processEvent(GuiEvent guiEvent, Game game, bool inGui);
private GuiEvent distributeEvent(GuiEvent guiEvent, Game game) { foreach (Gui g in heldGuiList) { if(guiEvent.type == GuiEventType.cancel){ return guiEvent; } guiEvent = g.distributeEvent(guiEvent, game); } processEvent(guiEvent, game, bounds.contains(guiEvent.mousePosition)); return guiEvent; }
protected override void processEvent(GuiEvent guiEvent, Game game, bool inGui) { }