Skip to content

Commit

Permalink
rename Scene#seeThrough from Scene#showPastScene
Browse files Browse the repository at this point in the history
  • Loading branch information
dera- committed Aug 28, 2023
1 parent d10b483 commit 8b692b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ export class Game {

// 描画するべき一番底のシーンを先に探しておく
let index = this.scenes.length - 1;
while (index >= 0 && this.scenes[index].showPastScene) --index;
while (index >= 0 && this.scenes[index].seeThrough) --index;
const renderBottomIndex = index;

for (let i = 0; i < renderers.length; ++i) {
Expand Down
6 changes: 3 additions & 3 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export interface SceneParameterObject {
* 前のシーンを後ろに描画するかどうか
* default: false
*/
showPastScene?: boolean;
seeThrough?: boolean;
}

/**
Expand Down Expand Up @@ -199,7 +199,7 @@ export class Scene implements StorageLoaderHandler {
/**
* 前のシーンを後ろに描画するかどうか
*/
showPastScene: boolean;
seeThrough: boolean;

/**
* 時間経過イベント。本イベントの一度のfireにつき、常に1フレーム分の時間経過が起こる。
Expand Down Expand Up @@ -532,7 +532,7 @@ export class Scene implements StorageLoaderHandler {
},
userData: null
});
this.showPastScene = param.showPastScene != null ? param.showPastScene : false;
this.seeThrough = param.seeThrough != null ? param.seeThrough : false;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/GameSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ describe("test Game", () => {
game.pushScene(beforeScene);
game._flushPostTickTasks();

const currentScene = new Scene({ game, showPastScene: true });
const currentScene = new Scene({ game, seeThrough: true });
const red = new FilledRect({
scene: currentScene,
cssColor: "red",
Expand All @@ -1666,7 +1666,7 @@ describe("test Game", () => {
game.pushScene(currentScene);
game._flushPostTickTasks();

// 現在のSceneのshowPastSceneがtrueの場合、1つ前のSceneから描画される
// 現在のSceneのseeThroughがtrueの場合、1つ前のSceneから描画される
game.render();
expect(r.methodCallParamsHistory("fillRect").length).toBe(2);
expect(r.methodCallParamsHistory("fillRect")[0].cssColor).toBe("gray");
Expand Down

0 comments on commit 8b692b1

Please sign in to comment.