File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed
Examples/Content/Scripts/2048/game Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -2,28 +2,21 @@ module.exports = function (widget,vbox) {
2
2
"use strict" ;
3
3
4
4
var instantiate = require ( 'instantiator' )
5
+ var UMG = require ( 'UMG' )
5
6
6
7
function test ( ) {
7
- var design = {
8
- id : 'button' ,
9
- type : Button ,
10
- children : [
11
- {
12
- type : TextBlock ,
13
- attrs : {
14
- Text : 'Reset'
15
- }
16
- }
17
- ]
18
- }
8
+ var design =
9
+ UMG ( Button , { id :'button' } ,
10
+ UMG . text ( { } , 'Reset' )
11
+ )
19
12
20
13
var widget = instantiate ( design )
21
14
vbox . AddChild ( widget )
22
15
return widget
23
16
}
24
17
25
18
var layout = test ( )
26
- var reset_button = Button . C ( layout . find ( 'button' ) )
19
+ var reset_button = Button ( layout . find ( 'button' ) )
27
20
28
21
function KeyboardInputManager ( ) {
29
22
this . events = { } ;
@@ -63,16 +56,16 @@ module.exports = function (widget,vbox) {
63
56
'Right' : ( ) => this . emit ( "move" , 3 )
64
57
}
65
58
66
- UserWidget . C ( widget . proxy ) . OnKeyDown = ( geom , keyevent ) => {
59
+ widget . proxy . OnKeyDown = ( geom , keyevent ) => {
67
60
var key = KismetInputLibrary . prototype . GetKey ( keyevent ) . KeyName
68
61
69
62
var op = map [ key ]
70
63
if ( op != undefined ) {
71
64
op ( )
72
- return WidgetBlueprintLibrary . Handled ( )
65
+ return Reply . Handled ( )
73
66
}
74
67
else {
75
- return WidgetBlueprintLibrary . Unhandled ( )
68
+ return Reply . Unhandled ( )
76
69
}
77
70
}
78
71
You can’t perform that action at this time.
0 commit comments