Răsfoiți Sursa

Fill reel grid and improve logo asset prompt

bang 2 săptămâni în urmă
părinte
comite
6aaad5e138
3 a modificat fișierele cu 21 adăugiri și 12 ștergeri
  1. 4 0
      exporter.py
  2. 1 1
      slot_workflow.py
  3. 16 11
      templates/SlotGame.ts

+ 4 - 0
exporter.py

@@ -37,6 +37,10 @@ def _symbol_fit_from_library(lib):
             continue
         max_dim = max(w, h)
         s = fill / max_dim
+        if w < h * 0.72:
+            s *= 1.12
+        if h < w * 0.72:
+            s *= 1.08
         # Spine 原点在素材底部中心,节点要下移半个实际显示高度才会视觉居中。
         oyf = (h * s) / 2.0
         fits[cid] = {"s": round(s, 6), "oyf": round(oyf, 4)}

+ 1 - 1
slot_workflow.py

@@ -140,7 +140,7 @@ UI_ART = [
     ("cover", False, "1024x1536", "vertical mobile game cover key art, title-safe top area, hero mascot and theme world, premium app store style, no small text"),
     ("loading_screen", False, "1024x1536", "vertical mobile game loading screen background, theme world, clear center area for progress bar, no characters, no text"),
     ("bg_main", False, "1024x1536", "vertical mobile slot game background, clear top area for logo, central reel area, bright themed world, no characters, no text"),
-    ("logo", True, "1024x1024", "glossy mobile slot game logo lettering, playful premium game title, thick outline, sparkles, transparent background"),
+    ("logo", True, "1536x1024", "actual readable mobile slot game title logo text, big bubble letters spelling the game title, thick gold outline, glossy themed fill, sparkles around letters, no empty frame, no badge without text, transparent background"),
     ("reel_frame", True, "1024x1024", "rounded rectangle slot machine reel frame, glowing border, hollow transparent center, clean mobile game UI element"),
     ("btn_spin", True, "1024x1024", "large round glossy spin button with circular arrows icon, premium 3D mobile game button, transparent background"),
     ("btn_round", True, "1024x1024", "small round glossy secondary mobile game UI button, blank center, transparent background"),

+ 16 - 11
templates/SlotGame.ts

@@ -117,6 +117,7 @@ export class SlotGame extends Component {
   private spinBtn!: Node;
   private particleTex: SpriteFrame | null = null;
   private frameCY = 0; private frameW = 0; private frameH = 0;
+  private cellW = 90; private cellH = 90;
   private W = 0; private H = 0;
   private symBaseY: number[][] = [];
   private t = 0;
@@ -172,12 +173,14 @@ export class SlotGame extends Component {
     this.frameW = fw; this.frameH = fh;
     this.frameCY = H * R.cy;
     const innerW = fw * R.holeW, innerH = fh * R.holeH;
-    this.cell = Math.min(innerW / COLS, innerH / ROWS);
-    this.gridX0 = -((COLS - 1) * this.cell) / 2;
-    this.gridY0 = this.frameCY + ((ROWS - 1) * this.cell) / 2;
+    this.cellW = innerW / COLS;
+    this.cellH = innerH / ROWS;
+    this.cell = Math.min(this.cellW, this.cellH);
+    this.gridX0 = -innerW / 2 + this.cellW / 2;
+    this.gridY0 = this.frameCY + innerH / 2 - this.cellH / 2;
   }
   private cellPos(c: number, r: number): [number, number] {
-    return [this.gridX0 + c * this.cell, this.gridY0 - r * this.cell];
+    return [this.gridX0 + c * this.cellW, this.gridY0 - r * this.cellH];
   }
 
   private buildBackground(W: number, H: number) {
@@ -456,7 +459,9 @@ export class SlotGame extends Component {
   private fit(id: string) { return SYMFIT[id] || SYMFIT_DEFAULT; }
 
   private buildGrid() {
-    const cardSize = this.cell * 0.92;
+    const cardW = this.cellW * 0.90;
+    const cardH = this.cellH * 0.90;
+    const cardR = Math.min(cardW, cardH) * 0.18;
     for (let c = 0; c < COLS; c++) {
       this.cells[c] = []; this.ids[c] = []; this.symBaseY[c] = [];
       for (let r = 0; r < ROWS; r++) {
@@ -465,12 +470,12 @@ export class SlotGame extends Component {
         const card = new Node(`card_${c}_${r}`); card.parent = this.node; card.setPosition(x, y, 0); card.setSiblingIndex(5);
         const cg = card.addComponent(Graphics);
         cg.fillColor = new Color(255, 255, 255, 215);
-        this.roundRect(cg, -cardSize / 2, -cardSize / 2, cardSize, cardSize, cardSize * 0.24); cg.fill();
+        this.roundRect(cg, -cardW / 2, -cardH / 2, cardW, cardH, cardR); cg.fill();
         cg.lineWidth = 3; cg.strokeColor = new Color(120, 175, 255, 240);
-        this.roundRect(cg, -cardSize / 2, -cardSize / 2, cardSize, cardSize, cardSize * 0.24); cg.stroke();
+        this.roundRect(cg, -cardW / 2, -cardH / 2, cardW, cardH, cardR); cg.stroke();
         const f = this.fit(id);
-        const scale = this.cell * f.s;
-        const baseY = y - this.cell * f.oyf;
+        const scale = Math.min(this.cellW, this.cellH) * f.s;
+        const baseY = y - Math.min(this.cellW, this.cellH) * f.oyf;
         this.symBaseY[c][r] = baseY;
         const node = new Node(`cell_${c}_${r}`); node.parent = this.node; node.setSiblingIndex(6);
         node.setPosition(x, baseY, 0); node.setScale(scale, scale, 1);
@@ -489,8 +494,8 @@ export class SlotGame extends Component {
     this.ids[c][r] = id;
     const [x, y] = this.cellPos(c, r);
     const f = this.fit(id);
-    const scale = this.cell * f.s;
-    const baseY = y - this.cell * f.oyf;
+    const scale = Math.min(this.cellW, this.cellH) * f.s;
+    const baseY = y - Math.min(this.cellW, this.cellH) * f.oyf;
     this.symBaseY[c][r] = baseY;
     const nd = sk.node;
     nd.setScale(scale, scale, 1);