UNPKG

blaze-2d

Version:

A fast and simple WebGL 2 2D game engine written in TypeScript

30 lines (29 loc) 872 B
import BlazeTitlebar from "./titleBar"; import "./styles/tab-bar.css"; import BlazeElement from "./element"; export default class BlazeTabBar extends BlazeTitlebar { tabs: string[]; tabElements: BlazeElement<HTMLParagraphElement>[]; private activeTab; /** * Function that is called when `activeTab` changes. */ activeCb: (tab: string) => void; /** * Creates an {@link BlazeTabBar} component. * * @param tabs The tab titles */ constructor(...tabs: string[]); /** * Creates and adds the tab elements to the bar. */ createTabElements(): void; /** * Adds the `active` class to the element for the given tab id. * * @param tab The id of the tab to mark * @param fireCallback wether or not to call `activeCb` */ markActive(tab: string, fireCallback?: boolean): void; }