Skip to content

Commit

Permalink
Examples: Fix mixing of tabs and spaces. Only use spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler committed Mar 29, 2018
1 parent b659215 commit b6db702
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 143 deletions.
92 changes: 46 additions & 46 deletions docs/examples/js/hscrollbar.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
var game = new Phaser.Game(400, 300, Phaser.AUTO, 'hscrollbar', { preload: preload, create: create });

function preload() {
game.load.image("dummyButton", "assets/horizontal/sprite.png");
game.load.image("track", "assets/horizontal/track.png");
game.load.spritesheet('bar', 'assets/horizontal/bar.png', 44, 22);
game.load.image("dummyButton", "assets/horizontal/sprite.png");
game.load.image("track", "assets/horizontal/track.png");
game.load.spritesheet('bar', 'assets/horizontal/bar.png', 44, 22);
}

function create() {
// Create a viewport. A "window" with a limited area of view.
var viewport = new uiWidgets.Viewport(game, 75, 75, 260, 128);

// Create a row. Anything added to a row is placed next to the previous thing added.
var row = new uiWidgets.Row(game);

// Put the row inside the viewport.
viewport.addNode(row);

// Add things to the row.
var dummy_sprite_a = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_b = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_c = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_d = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_e = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_f = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_g = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_h = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_i = this.game.add.sprite(0, 0, "dummyButton");

row.addNode(dummy_sprite_a);
row.addNode(dummy_sprite_b);
row.addNode(dummy_sprite_c);
row.addNode(dummy_sprite_d);
row.addNode(dummy_sprite_e);
row.addNode(dummy_sprite_f);
row.addNode(dummy_sprite_g);
row.addNode(dummy_sprite_h);
row.addNode(dummy_sprite_i);

// Create a scrollbar for the viewport.
var scrollbar = new uiWidgets.Scrollbar(
game,
viewport,
true,
false,
"track",
"bar",
{'duration': 300, 'ease': Phaser.Easing.Quadratic.Out}
);

// Place scrollbar below viewport.
scrollbar.alignTo(viewport, Phaser.BOTTOM_LEFT, 0, 10);
// Create a viewport. A "window" with a limited area of view.
var viewport = new uiWidgets.Viewport(game, 75, 75, 260, 128);

// Create a row. Anything added to a row is placed next to the previous thing added.
var row = new uiWidgets.Row(game);

// Put the row inside the viewport.
viewport.addNode(row);

// Add things to the row.
var dummy_sprite_a = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_b = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_c = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_d = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_e = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_f = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_g = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_h = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_i = this.game.add.sprite(0, 0, "dummyButton");

row.addNode(dummy_sprite_a);
row.addNode(dummy_sprite_b);
row.addNode(dummy_sprite_c);
row.addNode(dummy_sprite_d);
row.addNode(dummy_sprite_e);
row.addNode(dummy_sprite_f);
row.addNode(dummy_sprite_g);
row.addNode(dummy_sprite_h);
row.addNode(dummy_sprite_i);

// Create a scrollbar for the viewport.
var scrollbar = new uiWidgets.Scrollbar(
game,
viewport,
true,
false,
"track",
"bar",
{'duration': 300, 'ease': Phaser.Easing.Quadratic.Out}
);

// Place scrollbar below viewport.
scrollbar.alignTo(viewport, Phaser.BOTTOM_LEFT, 0, 10);
}
6 changes: 3 additions & 3 deletions docs/examples/js/quantitybar.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function create() {
{'duration': 400, 'ease': Phaser.Easing.Quadratic.Out}
);

rhealthbarText = game.add.text(350, 50, rhealthbar.valueRange.startValue, textStyle);
rhealthbarText = game.add.text(350, 50, rhealthbar.valueRange.startValue, textStyle);

var rlessHealth = game.add.button(450, 10, 'subtract', rdecreaseHealth, this);
var rmoreHealth = game.add.button(500, 10, 'add', rincreaseHealth, this);
Expand All @@ -85,7 +85,7 @@ function create() {
{'duration': 400, 'ease': Phaser.Easing.Quadratic.Out}
);

vhealthbarText = game.add.text(100, 150, vhealthbar.valueRange.startValue, textStyle);
vhealthbarText = game.add.text(100, 150, vhealthbar.valueRange.startValue, textStyle);

var vlessHealth = game.add.button(100, 250, 'subtract', vdecreaseHealth, this);
var vmoreHealth = game.add.button(150, 250, 'add', vincreaseHealth, this);
Expand All @@ -102,7 +102,7 @@ function create() {
{'duration': 400, 'ease': Phaser.Easing.Quadratic.Out}
);

rvhealthbarText = game.add.text(300, 150, rvhealthbar.valueRange.startValue, textStyle);
rvhealthbarText = game.add.text(300, 150, rvhealthbar.valueRange.startValue, textStyle);

var vlessHealth = game.add.button(300, 250, 'subtract', rvdecreaseHealth, this);
var vmoreHealth = game.add.button(350, 250, 'add', rvincreaseHealth, this);
Expand Down
80 changes: 40 additions & 40 deletions docs/examples/js/valuebar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var game = new Phaser.Game(600, 400, Phaser.AUTO, 'valuebar', { preload: preload, create: create });

function preload() {
game.load.image("track", "assets/valuebar/track.png");
game.load.spritesheet('bar', 'assets/valuebar/bar.png', 32, 32);
game.load.image("track", "assets/valuebar/track.png");
game.load.spritesheet('bar', 'assets/valuebar/bar.png', 32, 32);
game.load.image("vtrack", "assets/valuebar/vtrack.png");
game.load.image("alphaImage", "assets/valuebar/alpha.png");
}
Expand All @@ -17,19 +17,19 @@ var alphaImage;

function create() {

// Create a valuebar starting at 0.
valuebar0 = new uiWidgets.ValueBar(
game,
{"x": 50, "y": 10},
{"step": 1, "startValue": 0, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

valuebar0_text = game.add.text(50, 50, valuebar0.valueRange.startValue, {
// Create a valuebar starting at 0.
valuebar0 = new uiWidgets.ValueBar(
game,
{"x": 50, "y": 10},
{"step": 1, "startValue": 0, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

valuebar0_text = game.add.text(50, 50, valuebar0.valueRange.startValue, {
font: "65px Arial",
fill: "#ff0044",
align: "center"
Expand All @@ -40,19 +40,19 @@ function create() {
// Use the onMovement signal to update the display of text when the bar is moved.
valuebar0.onMovement.add(updateValueDisplay);

// Create a valuebar starting at 50.
valuebar50 = new uiWidgets.ValueBar(
game,
{"x": 50, "y": 150},
{"step": 25, "startValue": 50, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

valuebar50_text = game.add.text(50, 200, valuebar50.valueRange.startValue, {
// Create a valuebar starting at 50.
valuebar50 = new uiWidgets.ValueBar(
game,
{"x": 50, "y": 150},
{"step": 25, "startValue": 50, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

valuebar50_text = game.add.text(50, 200, valuebar50.valueRange.startValue, {
font: "65px Arial",
fill: "#ff0044",
align: "center"
Expand All @@ -62,18 +62,18 @@ function create() {
valuebar50.onMovement.add(updateValueDisplay);

// Create a vertical valuebar starting at 50.
vvaluebar50 = new uiWidgets.ValueBar(
game,
{"x": 350, "y": 50},
{"step": 25, "startValue": 50, maxValue: 100},
true,
true,
"vtrack",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

vvaluebar50_text = game.add.text(400, 200, valuebar50.valueRange.startValue, {
vvaluebar50 = new uiWidgets.ValueBar(
game,
{"x": 350, "y": 50},
{"step": 25, "startValue": 50, maxValue: 100},
true,
true,
"vtrack",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

vvaluebar50_text = game.add.text(400, 200, valuebar50.valueRange.startValue, {
font: "65px Arial",
fill: "#ff0044",
align: "center"
Expand Down
28 changes: 14 additions & 14 deletions docs/examples/js/valuebar_column.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ function create() {
// Create a quantitybar starting at 50.
bar = new uiWidgets.ValueBar(
game,
{"x": 0, "y": 0},
{"step": 25, "startValue": 50, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
{"x": 0, "y": 0},
{"step": 25, "startValue": 50, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

barText = game.add.text(50, 50, bar.valueRange.startValue, {
Expand All @@ -44,13 +44,13 @@ function create() {
// Create a quantitybar starting at 50.
bar2 = new uiWidgets.ValueBar(
game,
{"x": 0, "y": 0},
{"step": 25, "startValue": 50, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
{"x": 0, "y": 0},
{"step": 25, "startValue": 50, maxValue: 100},
true,
false,
"track",
"bar",
{'duration': 100, 'ease': Phaser.Easing.Quadratic.Out}
);

barText2 = game.add.text(50, 50, bar2.valueRange.startValue, {
Expand Down
80 changes: 40 additions & 40 deletions docs/examples/js/vscrollbar.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
var game = new Phaser.Game(600, 400, Phaser.AUTO, 'vscrollbar', { preload: preload, create: create });

function preload() {
game.load.image("dummyButton", "assets/vertical/sprite.png");
game.load.image("track", "assets/vertical/track.png");
game.load.spritesheet('bar', 'assets/vertical/bar.png', 22, 44);
game.load.image("dummyButton", "assets/vertical/sprite.png");
game.load.image("track", "assets/vertical/track.png");
game.load.spritesheet('bar', 'assets/vertical/bar.png', 22, 44);
}

function create() {

// Create a viewport. A "window" with a limited area of view.
var viewport = new uiWidgets.Viewport(game, 75, 75, 600, 260);

// Create a column. Anything added to a column is placed under the previous thing added.
var column = new uiWidgets.Column(game);

// Put the column inside the viewport.
viewport.addNode(column);

// Add things to the column.
var dummy_sprite_a = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_b = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_c = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_d = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_e = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_f = this.game.add.sprite(0, 0, "dummyButton");

column.addNode(dummy_sprite_a);
column.addNode(dummy_sprite_b);
column.addNode(dummy_sprite_c);
column.addNode(dummy_sprite_d);
column.addNode(dummy_sprite_e);
column.addNode(dummy_sprite_f);

// Create a scrollbar for the viewport.
var scrollbar = new uiWidgets.Scrollbar(
game,
viewport,
true,
true,
"track",
"bar",
{'duration': 300, 'ease': Phaser.Easing.Quadratic.Out}
);

// Place scrollbar next to viewport.
scrollbar.alignTo(viewport, Phaser.RIGHT_TOP, 10);
// Create a viewport. A "window" with a limited area of view.
var viewport = new uiWidgets.Viewport(game, 75, 75, 600, 260);

// Create a column. Anything added to a column is placed under the previous thing added.
var column = new uiWidgets.Column(game);

// Put the column inside the viewport.
viewport.addNode(column);

// Add things to the column.
var dummy_sprite_a = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_b = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_c = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_d = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_e = this.game.add.sprite(0, 0, "dummyButton");
var dummy_sprite_f = this.game.add.sprite(0, 0, "dummyButton");

column.addNode(dummy_sprite_a);
column.addNode(dummy_sprite_b);
column.addNode(dummy_sprite_c);
column.addNode(dummy_sprite_d);
column.addNode(dummy_sprite_e);
column.addNode(dummy_sprite_f);

// Create a scrollbar for the viewport.
var scrollbar = new uiWidgets.Scrollbar(
game,
viewport,
true,
true,
"track",
"bar",
{'duration': 300, 'ease': Phaser.Easing.Quadratic.Out}
);

// Place scrollbar next to viewport.
scrollbar.alignTo(viewport, Phaser.RIGHT_TOP, 10);
}

0 comments on commit b6db702

Please sign in to comment.