Skip to content

Commit fd1debe

Browse files
committed
Fix actuator.js that some function using wrong.
The score_attrs, best_attrs and message_attrs will have this different then its source, use .bind to bind the context.
1 parent fee65bb commit fd1debe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Examples/Content/Scripts/2048/game/actuator.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88

99
var widget = instantiate(design)
1010

11-
var score_attrs = widget.find('score').set_attrs
12-
var best_attrs = widget.find('best').set_attrs
13-
var message_attrs = widget.find('message').set_attrs
11+
var score_prop = widget.find('score');
12+
var score_attrs = score_prop.set_attrs.bind(score_prop);
13+
var best_prop = widget.find('best');
14+
var best_attrs = best_prop.set_attrs.bind(best_prop);
15+
var message_prop = widget.find('message');
16+
var message_attrs = message_prop.set_attrs.bind(message_prop);
1417

1518
score_attrs({ Text: 0 })
1619
best_attrs({ Text: 0 })

0 commit comments

Comments
 (0)