]> git.lizzy.rs Git - dragonblocks.git/commitdiff
Make dragonblocks.getTexture() return value contain background-size: cover
authorElias Fleckenstein <eliasfleckenstein@web.de>
Tue, 29 Jun 2021 14:49:01 +0000 (16:49 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Tue, 29 Jun 2021 14:49:01 +0000 (16:49 +0200)
engine/assets.js
engine/creative_inventory.js
engine/gui.js
engine/hotbar.js
engine/item_stack.js
engine/mainmenu.js
engine/map_display.js
engine/map_interaction.js
engine/skin.js
engine/spawned_entity.js

index aef234083ff28128dd164e3c096244479c994ac6..1e8c291825a6b9976ab7be39d0207019c7edf096 100644 (file)
@@ -41,7 +41,7 @@ dragonblocks.getTexture = name => {
 
        let path = dragonblocks.textures[name];
 
-       return path ? "url(" + path + ")" : name;
+       return path ? "left top/cover url(" + path + ")" : name;
 };
 
 dragonblocks.resolveTextures = elem => {
@@ -55,7 +55,7 @@ dragonblocks.resolveTextures = elem => {
 };
 
 dragonblocks.getSound = name => {
-       if(! name)
+       if (! name)
                return "";
 
        return dragonblocks.sounds[name] || name;
index b85331fcea062b3e74f4c21a3b0af78eeb5dba45..e94490dfae7d9efce0c5ec237a452b96e99e1537 100644 (file)
@@ -89,7 +89,6 @@ dragonblocks.CreativeInventory = class extends dragonblocks.Inventory
                        arrow.style.height = dragonblocks.settings.inventory.scale + "px";
                        arrow.style[dir] = "0px";
                        arrow.style.background = dragonblocks.getTexture("arrow.png");
-                       arrow.style.backgroundSize = "cover";
                        arrow.style.cursor = "pointer";
 
                        if (dir == "right")
index 3d6eea90d9ab6e485b000dee500d4d72b99ce451..5567e34db90dad1266636aab06dcd42d052178df 100644 (file)
@@ -96,7 +96,6 @@ dragonblocks.gui.Box = class extends EventTarget
                moveField.style.width = this.big ? "50px": "30px";
                moveField.style.height = this.big ? "50px": "30px";
                moveField.style.background = dragonblocks.getTexture("move.png");
-               moveField.style.backgroundSize = "cover"
                moveField.style.cursor = "move";
 
                let self = this;
@@ -136,7 +135,6 @@ dragonblocks.gui.Box = class extends EventTarget
                closeField.style.width = this.big ? "50px": "30px";
                closeField.style.height = this.big ? "50px": "30px";
                closeField.style.background = dragonblocks.getTexture("close.png");
-               closeField.style.backgroundSize = "cover";
                closeField.style.cursor = "pointer";
 
                let self = this;
index 755e03a7fd21752854acf3d1ddef915f33b71b4c..62f83095518e79da913fb8b2826861fb438e4ea5 100644 (file)
@@ -105,7 +105,6 @@ dragonblocks.Hotbar = class
                        slotDisplay.style.background = itemstack.item && dragonblocks.getTexture(itemstack.toItem().texture);
                        if (! slotDisplay.style.backgroundColor || slotDisplay.style.backgroundColor == "initial")
                                slotDisplay.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
-                       slotDisplay.style.backgroundSize = "cover";
 
                        slotCountDisplay.innerHTML = (itemstack.count <= 1) ? "" : itemstack.count;
 
index cee5ee68b5cc403b61b46c6ce4ceab3903bea708..2345446bb58cded381acf8c78f03910892895a94 100644 (file)
@@ -227,7 +227,6 @@ dragonblocks.ItemStack = class extends EventTarget
 
                        display.title = item.desc;
                        display.style.background = dragonblocks.getTexture(item.texture);
-                       display.style.backgroundSize = "cover";
 
                        if (this.count > 1)
                                countDisplay.innerHTML = this.count;
index a4ba2f01bcaed2b87446b48a9632c3832ccf5db2..a525c0a9ee76ca7a522e342c7b61a783a16e3204 100644 (file)
                        arrow.style.position = "absolute";
                        arrow.style[dir] = "3px";
                        arrow.style.background = dragonblocks.getTexture("arrow.png");
-                       arrow.style.backgroundSize = "cover";
                        arrow.style.cursor = "pointer";
 
                        if (dir == "right")
index 474cb8a42e968b912824fdc0961e39588327bc66..58c64ffcfb6265a66028fd60f3fbee405a419cc4 100644 (file)
@@ -136,7 +136,6 @@ dragonblocks.MapDisplay = class
 
                if (mapNodeDef) {
                        node.style.background = dragonblocks.getTexture(mapNodeDef.texture);
-                       node.style.backgroundSize = "cover";
                        node.style.zIndex = mapNodeDef.zIndex || "1";
                } else {
                        node.style.background = "black";
index 6220a4e9e5ee747d55fd5d85191f4db79bea7c86..2345f6664b4987db5099613b251ee75837009ba4 100644 (file)
@@ -27,7 +27,6 @@ dragonblocks.MapInteraction = {
                this.tmp.crackDisplay = this.map.entityContainer.appendChild(document.createElement("div"));
                this.tmp.crackDisplay.style.position = "absolute";
                this.tmp.crackDisplay.style.visibility = "hidden";
-               this.tmp.crackDisplay.style.backgroundSize = "cover";
                this.tmp.crackDisplay.style.height = dragonblocks.settings.mapDisplay.scale + "px";
                this.tmp.crackDisplay.style.width = dragonblocks.settings.mapDisplay.scale + "px";
                this.tmp.crackDisplay.style.boxShadow = "0 0 0 1px black inset";
@@ -115,7 +114,6 @@ dragonblocks.MapInteraction = {
                        nodeDef.playSound("dig");
 
                        this.tmp.crackDisplay.style.background = dragonblocks.getTexture("crack" + Math.floor(node.meta.causedDamage / nodeDef.hardness * 5) + ".png");
-                       this.tmp.crackDisplay.style.backgroundSize = "cover";
                        this.tmp.crackDisplay.style.zIndex = nodeDef.zIndex || "1";
 
                        this.tmp.digTimeout = setTimeout(_ => {
index ea1e1f7bf6cb4b6b70db52053ad4bcbfdd0b1ab3..d9c455511da303e0a4308f759bd47ad38fe28bb8 100644 (file)
@@ -70,7 +70,6 @@ dragonblocks.registerSkin = def => {
                        skinDisplay.style.width = parseInt(dragonblocks.settings.map.scale) + "px";
                        skinDisplay.style.height = parseInt(dragonblocks.settings.map.scale * 2) + "px";
                        skinDisplay.style.background = dragonblocks.getTexture(def.texture);
-                       skinDisplay.style.backgroundSize = "cover";
                        skinDisplay.title = def.name + (def.desc ? "\n" + def.desc : "");
 
                        if (dragonblocks.player.skin == def.name)
index 5bbb96e3c15945d8f8714ccb2635befcccdca1d3..f2c0635ad596ebb584ba2df4fc6fe0ccdf842540 100644 (file)
@@ -246,7 +246,6 @@ dragonblocks.SpawnedEntity = class
        updateTexture()
        {
                this.tmp.display.style.background = dragonblocks.getTexture(this.texture);
-               this.tmp.display.style.backgroundSize = "cover";
        }
 
        teleport(x, y)