/// <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 AddCustomRender(this GuiComposer composer, ElementBounds bounds, RenderDelegateWithBounds onRender) { if (!composer.composed) { composer.AddInteractiveElement(new GuiElementCustomRender(composer.Api, bounds, onRender)); } 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="onRender">The event fired when the object is drawn.</param> public GuiElementCustomRender(ICoreClientAPI capi, ElementBounds bounds, RenderDelegateWithBounds onRender) : base(capi, bounds) { this.onRender = onRender; }