mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
Updated text display alignment for a few games.
This commit is contained in:
parent
bd3e3cd083
commit
db720f0079
4 changed files with 21 additions and 19 deletions
|
@ -86,13 +86,14 @@ class AcesAndKings(Game):
|
||||||
stack = AcesAndKings_FoundationStack(x, y, self, suit=j,
|
stack = AcesAndKings_FoundationStack(x, y, self, suit=j,
|
||||||
base_rank=i[0], dir=1,
|
base_rank=i[0], dir=1,
|
||||||
max_cards=(13 - i[0]))
|
max_cards=(13 - i[0]))
|
||||||
stack.texts.misc = MfxCanvasText(self.canvas,
|
if self.preview <= 1:
|
||||||
x + l.CW // 2,
|
stack.texts.misc = MfxCanvasText(self.canvas,
|
||||||
y + l.CH // 2,
|
x + l.CW // 2,
|
||||||
anchor="center",
|
y + l.CH // 2,
|
||||||
font=font)
|
anchor="center",
|
||||||
stack.texts.misc.config(text=(RANKS[i[0]][0]))
|
font=font)
|
||||||
s.foundations.append(stack)
|
stack.texts.misc.config(text=(RANKS[i[0]][0]))
|
||||||
|
s.foundations.append(stack)
|
||||||
|
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
x = x + (l.XS / 2)
|
x = x + (l.XS / 2)
|
||||||
|
@ -100,13 +101,14 @@ class AcesAndKings(Game):
|
||||||
stack = AcesAndKings_FoundationStack(x, y, self, suit=j,
|
stack = AcesAndKings_FoundationStack(x, y, self, suit=j,
|
||||||
base_rank=i[1], dir=-1,
|
base_rank=i[1], dir=-1,
|
||||||
max_cards=(i[1] + 1))
|
max_cards=(i[1] + 1))
|
||||||
stack.texts.misc = MfxCanvasText(self.canvas,
|
if self.preview <= 1:
|
||||||
x + l.CW // 2,
|
stack.texts.misc = MfxCanvasText(self.canvas,
|
||||||
y + l.CH // 2,
|
x + l.CW // 2,
|
||||||
anchor="center",
|
y + l.CH // 2,
|
||||||
font=font)
|
anchor="center",
|
||||||
stack.texts.misc.config(text=(RANKS[i[1]][0]))
|
font=font)
|
||||||
s.foundations.append(stack)
|
stack.texts.misc.config(text=(RANKS[i[1]][0]))
|
||||||
|
s.foundations.append(stack)
|
||||||
|
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
x, y = l.XM, y + l.YS
|
x, y = l.XM, y + l.YS
|
||||||
|
|
|
@ -132,7 +132,7 @@ class Canfield(Game):
|
||||||
tx, ty, ta, tf = lay.getTextAttr(None, "se")
|
tx, ty, ta, tf = lay.getTextAttr(None, "se")
|
||||||
tx, ty = x + tx + lay.XM, y + ty
|
tx, ty = x + tx + lay.XM, y + ty
|
||||||
else:
|
else:
|
||||||
tx, ty, ta, tf = lay.getTextAttr(None, "ss")
|
tx, ty, ta, tf = lay.getTextAttr(None, "s")
|
||||||
tx, ty = x + tx, y + ty
|
tx, ty = x + tx, y + ty
|
||||||
font = self.app.getFont("canvas_default")
|
font = self.app.getFont("canvas_default")
|
||||||
self.texts.info = MfxCanvasText(self.canvas, tx, ty,
|
self.texts.info = MfxCanvasText(self.canvas, tx, ty,
|
||||||
|
|
|
@ -735,11 +735,11 @@ class Crescent(Game):
|
||||||
l, s = Layout(self), self.s
|
l, s = Layout(self), self.s
|
||||||
playcards = 10
|
playcards = 10
|
||||||
w0 = l.XS+(playcards-1)*l.XOFFSET
|
w0 = l.XS+(playcards-1)*l.XOFFSET
|
||||||
w, h = l.XM+max(4*w0, 9*l.XS), l.YM+5*l.YS
|
w, h = l.XM+max(4*w0, 9*l.XS), l.YM + 5 * l.YS + l.TEXT_HEIGHT
|
||||||
self.setSize(w, h)
|
self.setSize(w, h)
|
||||||
x, y = l.XM, l.YM
|
x, y = l.XM, l.YM
|
||||||
s.talon = Crescent_Talon(x, y, self, max_rounds=4)
|
s.talon = Crescent_Talon(x, y, self, max_rounds=4)
|
||||||
l.createRoundText(s.talon, 'ne')
|
l.createRoundText(s.talon, 's')
|
||||||
x, y = w-8*l.XS, l.YM
|
x, y = w-8*l.XS, l.YM
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
|
s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
|
||||||
|
@ -748,7 +748,7 @@ class Crescent(Game):
|
||||||
s.foundations.append(SS_FoundationStack(x, y, self, suit=i,
|
s.foundations.append(SS_FoundationStack(x, y, self, suit=i,
|
||||||
base_rank=KING, dir=-1))
|
base_rank=KING, dir=-1))
|
||||||
x += l.XS
|
x += l.XS
|
||||||
y = l.YM+l.YS
|
y = l.YM + l.YS + l.TEXT_HEIGHT
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
x = l.XM
|
x = l.XM
|
||||||
for j in range(4):
|
for j in range(4):
|
||||||
|
|
|
@ -138,7 +138,7 @@ class PushPin(Game):
|
||||||
|
|
||||||
pad = 1
|
pad = 1
|
||||||
if self.Comment:
|
if self.Comment:
|
||||||
pad = 5
|
pad = l.TEXT_HEIGHT
|
||||||
|
|
||||||
# set window
|
# set window
|
||||||
xx, yy = 9, 6
|
xx, yy = 9, 6
|
||||||
|
|
Loading…
Add table
Reference in a new issue