Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2013-09-24 15:20:03 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-09-24 15:20:03 (GMT)
commita984ba9327b624b78495cec18eb6870ca2c7d96e (patch)
tree1cd866f2a6627afd6a7b26f713846d686cc66126 /src
parent13c2aa54ec35accecfb19d2f24082e447f328e42 (diff)
better select partida mouse over
Diffstat (limited to 'src')
-rw-r--r--src/assets/images/selectPartida/recuadro.pngbin9954 -> 9533 bytes
-rw-r--r--src/assets/images/selectPartida/recuadro_old.pngbin0 -> 9954 bytes
-rw-r--r--src/game/SelectPartidaState.py38
3 files changed, 24 insertions, 14 deletions
diff --git a/src/assets/images/selectPartida/recuadro.png b/src/assets/images/selectPartida/recuadro.png
index 611dd8f..ef9b53a 100644
--- a/src/assets/images/selectPartida/recuadro.png
+++ b/src/assets/images/selectPartida/recuadro.png
Binary files differ
diff --git a/src/assets/images/selectPartida/recuadro_old.png b/src/assets/images/selectPartida/recuadro_old.png
new file mode 100644
index 0000000..611dd8f
--- /dev/null
+++ b/src/assets/images/selectPartida/recuadro_old.png
Binary files differ
diff --git a/src/game/SelectPartidaState.py b/src/game/SelectPartidaState.py
index a38a481..949b88c 100644
--- a/src/game/SelectPartidaState.py
+++ b/src/game/SelectPartidaState.py
@@ -8,6 +8,8 @@ from api.Sprite2 import CSprite
from api.Globe import Globe
from api.Button import CButton
from api.PartidasMan import Partida
+from api.Mouse import CMouse
+import api.Math as CMath
from SelectCharacterState import CSelectCharacterState
from SelectAreaState import CSelectAreaState
@@ -28,9 +30,13 @@ class CSelectPartidaState(CGameState):
self.mBackground = Image.loadImage('assets/images/selectArea/background.jpg', False)
CGame().setBackground(self.mBackground)
+ self.PARTIDA1_RECT = [(114, 254), (385, 625)]
+ self.PARTIDA2_RECT = [(464, 254), (735, 625)]
+ self.PARTIDA3_RECT = [(815, 254), (1086, 625)]
+
self.mOverEnabled = True
self.mToDel = None
- self.mFlag = 0
+ self.mFlag = 60
self.misEmptyP1 = True
self.misEmptyP2 = True
@@ -68,7 +74,7 @@ class CSelectPartidaState(CGameState):
recuadro = Image.loadImage('assets/images/selectPartida/recuadro.png')
self.mPartida1 = CSprite()
- self.mPartida1.setXY(100, 240)
+ self.mPartida1.setXY(114, 254)
self.mPartida1.setImage(recuadro)
CGame().addChild(self.mPartida1)
@@ -79,7 +85,7 @@ class CSelectPartidaState(CGameState):
self.mPartida1Is = False
self.mPartida2 = CSprite()
- self.mPartida2.setXY(450, 240)
+ self.mPartida2.setXY(464, 254)
self.mPartida2.setImage(recuadro)
CGame().addChild(self.mPartida2)
@@ -89,7 +95,7 @@ class CSelectPartidaState(CGameState):
self.mPartida2Is = False
self.mPartida3 = CSprite()
- self.mPartida3.setXY(800, 240)
+ self.mPartida3.setXY(815, 254)
self.mPartida3.setImage(recuadro)
CGame().addChild(self.mPartida3)
@@ -187,7 +193,7 @@ class CSelectPartidaState(CGameState):
else:
self.misEmptyP1 = False
CGame().addChild(self.mLabel1)
- CGame().addChild(self.mDeletePartida1)
+ CGame().addChild(self.mDeletePartida1, 1)
if par.getCharacter() == 'Juan':
self.mChar1.setImage(juan)
else:
@@ -234,7 +240,7 @@ class CSelectPartidaState(CGameState):
else:
self.misEmptyP2 = False
CGame().addChild(self.mLabel2)
- CGame().addChild(self.mDeletePartida2)
+ CGame().addChild(self.mDeletePartida2, 1)
if par.getCharacter() == 'Juan':
self.mChar2.setImage(juan)
else:
@@ -281,7 +287,7 @@ class CSelectPartidaState(CGameState):
else:
self.misEmptyP3 = False
CGame().addChild(self.mLabel3)
- CGame().addChild(self.mDeletePartida3)
+ CGame().addChild(self.mDeletePartida3, 1)
if par.getCharacter() == 'Juan':
self.mChar3.setImage(juan)
else:
@@ -350,11 +356,11 @@ class CSelectPartidaState(CGameState):
self.mButtonFalse.set_text(_('Cancelar'))
def addDialog(self):
- CGame().addChild(self.mAlpha)
+ CGame().addChild(self.mAlpha, 1)
self.mOverEnabled = False
- CGame().addChild(self.mDialog)
- CGame().addChild(self.mButtonTrue)
- CGame().addChild(self.mButtonFalse)
+ CGame().addChild(self.mDialog, 2)
+ CGame().addChild(self.mButtonTrue, 2)
+ CGame().addChild(self.mButtonFalse, 2)
def update(self):
#print "menu update"
@@ -398,6 +404,7 @@ class CSelectPartidaState(CGameState):
if self.mFlag < 0:
self.mFlag = 0
if self.mFlag == 0:
+
if self.mPartida1.clicked():
print "partida 1"
if self.misEmptyP1:
@@ -427,8 +434,11 @@ class CSelectPartidaState(CGameState):
CGame().setState(ch)
ch.setPartida(3)
return
+
+ x = CMouse().getX()
+ y = CMouse().getY()
- if self.mPartida1.mouseOver():
+ if (CMath.pointInsideRectangle(x,y,self.PARTIDA1_RECT)):
if not(self.mPartida1Is):
self.mPartida1Is = True
CGame().addChild(self.mBorderPartida1)
@@ -439,7 +449,7 @@ class CSelectPartidaState(CGameState):
CGame().removeChild(self.mBorderPartida1)
return
- if self.mPartida2.mouseOver():
+ if (CMath.pointInsideRectangle(x,y,self.PARTIDA2_RECT)):
if not(self.mPartida2Is):
self.mPartida2Is = True
CGame().addChild(self.mBorderPartida2)
@@ -450,7 +460,7 @@ class CSelectPartidaState(CGameState):
CGame().removeChild(self.mBorderPartida2)
return
- if self.mPartida3.mouseOver():
+ if (CMath.pointInsideRectangle(x,y,self.PARTIDA3_RECT)):
if not(self.mPartida3Is):
self.mPartida3Is = True
CGame().addChild(self.mBorderPartida3)