/// <summary> /// Adds a static custom draw component to the GUI. /// </summary> /// <param name="bounds">The bounds of the component.</param> /// <param name="OnDraw">The event fired when the element is drawn.</param> public static GuiComposer AddStaticCustomDraw(this GuiComposer composer, ElementBounds bounds, DrawDelegateWithBounds OnDraw) { if (!composer.Composed) { composer.AddStaticElement(new GuiElementCustomDraw(composer.Api, bounds, OnDraw)); } return(composer); }
/// <summary> /// Adds a dynamic custom draw component to the GUI. /// </summary> /// <param name="bounds">The bounds of the component.</param> /// <param name="OnDraw">The event fired when the element is drawn.</param> /// <param name="key">The name of the element.</param> public static GuiComposer AddDynamicCustomDraw(this GuiComposer composer, ElementBounds bounds, DrawDelegateWithBounds OnDraw, string key = null) { if (!composer.Composed) { composer.AddInteractiveElement(new GuiElementCustomDraw(composer.Api, bounds, OnDraw, true), key); } return(composer); }
/// <summary> /// Adds a custom drawing element to the GUI /// </summary> /// <param name="capi">The Client API</param> /// <param name="bounds">The bounds of the Element</param> /// <param name="OnDraw">The event fired when the object is drawn.</param> /// <param name="interactive">Whether or not the element is able to be interacted with (Default: false)</param> public GuiElementCustomDraw(ICoreClientAPI capi, ElementBounds bounds, DrawDelegateWithBounds OnDraw, bool interactive = false) : base(capi, bounds) { this.OnDraw = OnDraw; this.interactive = interactive; }