mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-28 14:44:12 +00:00
fix: update spritesheet and data
This commit is contained in:
parent
01bb44965d
commit
94e560a60d
7 changed files with 7 additions and 731 deletions
|
|
@ -31,7 +31,7 @@ function Blocks({ blocks, setBlocks, textures, image, imageDimensions, coords, s
|
|||
tilemap.clear();
|
||||
|
||||
blocks.forEach((block) => {
|
||||
tilemap.tile(textures[block.name] ?? missingTexture, block.x * 16, block.y * 16);
|
||||
tilemap.tile(textures[`${block.name}.png`] ?? missingTexture, block.x * 16, block.y * 16);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ function SelectedBlock() {
|
|||
const { selectedBlock } = useContext(ToolContext);
|
||||
|
||||
const convertToDataUrl = (textureName: string): string => {
|
||||
// Show missing texture if fail
|
||||
if (!textures["stone"])
|
||||
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGUlEQVR42mPABX4w/MCKaKJhVMPgcOuoBgDZRfgBVl5QdQAAAABJRU5ErkJggg==";
|
||||
const texture = textures[textureName];
|
||||
|
||||
const canvas = document.createElement("canvas");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue