|
|
@@ -1,11 +1,12 @@ |
|
|
|
import arcade |
|
|
|
from gui_aux import * |
|
|
|
from desktop_Platform import * |
|
|
|
|
|
|
|
def desktop_createDeselectedTiles(p): |
|
|
|
for (id, pos) in enumerate(p.c.tilePositions): |
|
|
|
tile = arcade.AnimatedTimeBasedSprite() |
|
|
|
p.deselectedTiles.append(tile) |
|
|
|
p.sprites.append(tile) |
|
|
|
p.deselectedSprites.append(tile) |
|
|
|
|
|
|
|
tile.guid = id |
|
|
|
tile.texture = p.textures[0] |
|
|
@@ -24,7 +25,7 @@ def desktop_createSelectedTiles(p): |
|
|
|
for (id, pos) in enumerate(p.c.tilePositions): |
|
|
|
tile = arcade.Sprite() |
|
|
|
p.selectedTiles.append(tile) |
|
|
|
p.sprites.append(tile) |
|
|
|
p.selectedSprites.append(tile) |
|
|
|
|
|
|
|
tile.guid = id |
|
|
|
tile.texture = p.textures[2 + p.c.playfieldItems[id]] |
|
|
@@ -36,6 +37,18 @@ def desktop_createSelectedTiles(p): |
|
|
|
#} |
|
|
|
#} |
|
|
|
|
|
|
|
def desktop_createTitle(p): |
|
|
|
p.title = arcade.Sprite() |
|
|
|
p.titleSprites.append(p.title) |
|
|
|
p.title.texture = p.titleTextures[0] |
|
|
|
# Position. |
|
|
|
pos = gui_aux_cellScreenPosition(p.c, p.c.titlePosition) |
|
|
|
p.title.left = pos[0] |
|
|
|
p.title.top = pos[1] |
|
|
|
# Invisible by default. |
|
|
|
p.title.visible = False |
|
|
|
#} |
|
|
|
|
|
|
|
# Deselect mismatched tiles |
|
|
|
# |
|
|
|
# Conditions: |
|
|
@@ -80,6 +93,7 @@ def desktop_hideMatchingTiles(p): |
|
|
|
#} |
|
|
|
#} |
|
|
|
|
|
|
|
# Load tile textures |
|
|
|
def desktop_loadTextures(p): |
|
|
|
texs = [] |
|
|
|
for (id, td) in enumerate(p.c.textureDescriptions): |
|
|
@@ -95,6 +109,22 @@ def desktop_loadTextures(p): |
|
|
|
p.textures = texs |
|
|
|
#} |
|
|
|
|
|
|
|
# Load tiTLe textures |
|
|
|
def desktop_loadTitleTextures(p): |
|
|
|
texs = [] |
|
|
|
for (id, td) in enumerate(p.c.titleTextureDescriptions): |
|
|
|
tex = arcade.load_texture( |
|
|
|
td.fileName, |
|
|
|
x = td.x, |
|
|
|
y = td.y, |
|
|
|
width = td.width, |
|
|
|
height = td.height |
|
|
|
) |
|
|
|
texs.append(tex) |
|
|
|
#} |
|
|
|
p.titleTextures = texs |
|
|
|
#} |
|
|
|
|
|
|
|
# Postpone deselection of mismatched tiles for better UX |
|
|
|
# |
|
|
|
# Conditions: |
|
|
|