(Inside whack.base)
-
Nodeimplements eventsEvent.ENTER_FRAME,Event.COMPONENT_DID_MOUNTandEvent.COMPONENT_WILL_UNMOUNTforUIComponents(methods such asaddChild()andremoveChild()must trigger them "RECURSIVELY").COMPONENT_DID_MOUNTis dispatched after the component has been added as a descendant of the topmostApplicationcomponent.COMPONENT_WILL_UNMOUNTis dispatched before the component is removed as a descendant from the topmostApplicationcomponent.
- Dispatch it when entering frames on
whack.components.UIComponentandwhack.gfx.DisplayObject.
(Inside whack.base)
Includes the UIComponent and Application classes using specific behavior for client side and server side.
Mechanisms:
- Register shortcut actions (keyboard and gamepad) in an application, including global shortcut events (such as update, button press, button release) and retrieving button pressure.
- Internationalization in an application, including global language events.
- Nest themes. Components may link an optional theme to be nested with that of the
Application. - When theme is updated (hierarchically), trigger
Event.THEME_UPDATEfor every descendant of a component. - Provide CSS color retrieval method for a specific
UIComponent(computes browser's CSScolorproperty). - On
Event.COMPONENT_WILL_UNMOUNT, ensure internally generated CSS blocks are disposed from components that generated them.
Defines components used by HTML tags.
(Inside whack.base)
(Inside whack.base)
(Inside whack.base)
-
Event#clone()should useObject.clone()by default.
(Inside whack.base)
-
Color(wrap the NPMcolorpackage) - Provide
ColorObserver, which triggersColorObserverEvent.UPDATE_COLORwithcolor : whack.utils.Colorwhenever CSS character color is possibly updated.- Implementation: constructor takes (component) and checks for
Event.THEME_UPDATE(use setTimeout of 90ms to trigger update), and, for every parent, checks forFocusEvent.FOCUS_IN,FocusEvent.FOCUS_OUT,MouseEvent.MOUSE_DOWN,MouseEvent.CLICK,MouseEvent.MOUSE_OVER,MouseEvent.MOUSE_UP,MouseEvent.MOUSE_OUT(these listeners are removed onEvent.COMPONENT_WILL_UNMOUNT). OnEvent.COMPONENT_DID_MOUNT, triggerColorObserverEvent.UPDATE_COLORonce (use setTimeout of 70ms to trigger update). - Implementation: get
colorCSS property's value from HTML element's computed style. - Use-cases: icons adaptive to light or dark themes.
- Document it
- Implementation: constructor takes (component) and checks for
(Outside whack.base)
whack.gfx.* is implemented in an optional package that the user may depend in. It includes:
- The
Canvasuser interface component. - The
DisplayObjecthierarchy of classes (not the same concept as Flash Display List, but very close).BitmapShape(supports geometric graphics drawing)TextAreaMovieClip
Maybe implement it with PIXI.js if the clipping bug solves itself: may consider recreating the PIXI.js Application instance and reparenting previous children into new stage, at every resize event. Perhaps that works? And in that case, Shape would be rendered into a PIXI.js bitmap as needed.