mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-28 14:44:12 +00:00
refactor: move setting blocks to welcomeBlocksData to canvas context
This commit is contained in:
parent
17dc511053
commit
53f81040be
3 changed files with 4 additions and 7 deletions
|
|
@ -35,7 +35,6 @@ function Blocks({ blocks, missingTexture, textures, coords, scale, version }: Pr
|
|||
useEffect(() => {
|
||||
const tilemap = new CompositeTilemap();
|
||||
tilemapRef.current = tilemap;
|
||||
tilemap.cullable = true;
|
||||
app.stage.addChildAt(tilemap, 0);
|
||||
|
||||
tileBlocks();
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ import CanvasBorder from "./CanvasBorder";
|
|||
import CursorInformation from "./information/Cursor";
|
||||
import CanvasInformation from "./information/Canvas";
|
||||
|
||||
import welcomeBlocksData from "@/data/welcome.json";
|
||||
|
||||
// Set scale mode to NEAREST
|
||||
PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;
|
||||
|
||||
|
|
@ -460,8 +458,6 @@ function Canvas() {
|
|||
}, [stageContainerRef]);
|
||||
|
||||
useEffect(() => {
|
||||
setBlocks(welcomeBlocksData);
|
||||
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
window.addEventListener("keyup", onKeyUp);
|
||||
window.addEventListener("beforeunload", (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue