瀏覽代碼

Fixing tsdoc lint & whats new doc.

Flux159 4 年之前
父節點
當前提交
4b6d8f0085
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 3 0
      dist/preview release/what's new.md
  2. 3 1
      gui/src/2D/controls/focusableButton.ts

+ 3 - 0
dist/preview release/what's new.md

@@ -4,6 +4,9 @@
 
 ## Updates
 
+- Added a `FocusableButton` gui control to simplify creating menus with keyboard navigation ([Flux159](https://github.com/Flux159))
+- Added `focus()` and `blur()` functions for controls that implement `IFocusableControl` ([Flux159](https://github.com/Flux159))
+
 ### Materials
 
 - Added an `OcclusionMaterial` to simplify depth-only rendering of geometry ([rgerd](https://github.com/rgerd))

+ 3 - 1
gui/src/2D/controls/focusableButton.ts

@@ -12,8 +12,9 @@ import { Observable } from 'babylonjs/Misc/observable';
  * Class used to create a focusable button that can easily handle keyboard events
  */
 export class FocusableButton extends Button implements IFocusableControl {
-    private _isFocused = false;
+    /** Highlight color when button is focused */
     public focusedColor: Nullable<string> = null;
+    private _isFocused = false;
     private _unfocusedColor: Nullable<string> = null;
 
     /** Observable raised when the control gets the focus */
@@ -91,6 +92,7 @@ export class FocusableButton extends Button implements IFocusableControl {
         super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi);
     }
 
+    /** @hidden */
     public displose() {
         super.dispose();