diff --git a/src/objects/Button.ts b/src/objects/Button.ts index 36a0afd..a9e121b 100644 --- a/src/objects/Button.ts +++ b/src/objects/Button.ts @@ -109,6 +109,7 @@ export class Button { this._textures.set(states.HOVER, this.drawText(this._mesh.name, this._hoverColor, this._hoverBackground)); this._textures.set(states.CLICK, this.drawText(this._mesh.name, this._clickColor, this._clickBackground)); mat.emissiveTexture = this._textures.get(states.NORMAL); + mat.opacityTexture = mat.emissiveTexture; mat.disableLighting = true; return mat; } @@ -123,8 +124,9 @@ export class Button { ctx2d.font = font; ctx2d.textBaseline = 'middle'; ctx2d.textAlign = 'center'; + ctx2d.roundRect(0, 0, this._width * this._density, this._height * this._density, 32); ctx2d.fillStyle = background.toHexString(); - ctx2d.fillRect(0, 0, this._width * this._density, this._height * this._density); + ctx2d.fill(); ctx2d.fillStyle = foreground.toHexString(); const lines = split(ctx2d, name, font, this._width * this._density, true); const x = this._width * this._density / 2; diff --git a/src/objects/handle.ts b/src/objects/handle.ts index be905a1..42eebc1 100644 --- a/src/objects/handle.ts +++ b/src/objects/handle.ts @@ -46,6 +46,7 @@ export class Handle { const texture = this.drawText(this._label, Color3.White(), Color3.Black()); const material = new StandardMaterial('handleMaterial', scene); material.emissiveTexture = texture; + material.opacityTexture = texture; material.disableLighting = true; handle.material = material; //handle.rotate(Vector3.Up(), Math.PI); @@ -86,8 +87,9 @@ export class Handle { ctx2d.font = font; ctx2d.textBaseline = 'middle'; ctx2d.textAlign = 'center'; + ctx2d.roundRect(0, 0, 512, 64, 32); ctx2d.fillStyle = background.toHexString(); - ctx2d.fillRect(0, 0, 512, 64); + ctx2d.fill(); ctx2d.fillStyle = foreground.toHexString(); const lines = split(ctx2d, name, font, 512, true); const x = 256; diff --git a/vite.config.ts b/vite.config.ts index e8f1654..41996b7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,9 @@ import {defineConfig} from "vite"; export default defineConfig({ test: {}, define: {}, + build: { + sourcemap: "inline" + }, optimizeDeps: { esbuildOptions: { define: {