Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
bargame.Gcompris_bargame.hole Class Reference

List of all members.

Public Member Functions

def __init__
def isBlue
def isGreen

Public Attributes

 board
 itemgroup
 scale
 ombre
 ball

Detailed Description

Definition at line 310 of file bargame.py.


Constructor & Destructor Documentation

def bargame.Gcompris_bargame.hole.__init__ (   self,
  board,
  root,
  x,
  y,
  index,
  board_size,
  scale 
)

Definition at line 313 of file bargame.py.

00313 
00314                  scale):
00315       self.board = board
00316 
00317       self.itemgroup = root.add(
00318         gnomecanvas.CanvasGroup,
00319         x=x,
00320         y=y)
00321 
00322       self.scale = scale
00323 
00324       if (index == (board_size-1)):
00325         pixbuf_case = self.board.pixmap_case_last
00326         pixbuf_mask = self.board.pixmap_mask_last
00327       else:
00328         pixbuf_case = self.board.pixmap_case
00329         pixbuf_mask = self.board.pixmap_mask
00330 
00331 
00332       item = self.itemgroup.add(
00333         gnomecanvas.CanvasPixbuf,
00334         pixbuf = pixbuf_case,
00335         x=0,
00336         y=0)
00337       bounds = item.get_bounds()
00338       item.set(width  = (bounds[2]-bounds[0])*scale,
00339                height = (bounds[3]-bounds[1])*scale,
00340                width_set  = True,
00341                height_set = True)
00342 
00343       self.ombre = self.itemgroup.add(
00344         gnomecanvas.CanvasPixbuf,
00345         pixbuf = self.board.pixmap_ombre,
00346         x=0,
00347         y=0)
00348       self.ombre.hide()
00349       bounds = self.ombre.get_bounds()
00350       self.ombre.set(width  = (bounds[2]-bounds[0])*scale,
00351                      height = (bounds[3]-bounds[1])*scale,
00352                      width_set  = True,
00353                      height_set = True)
00354 
00355       self.ball = self.itemgroup.add(
00356         gnomecanvas.CanvasPixbuf,
00357         x=0,
00358         y=0)
00359       self.ball.hide()
00360 
00361       item = self.itemgroup.add(
00362         gnomecanvas.CanvasPixbuf,
00363         pixbuf = pixbuf_mask,
00364         x=0,
00365         y=0)
00366       bounds = item.get_bounds()
00367       item.set(width  = (bounds[2]-bounds[0])*scale,
00368                height = (bounds[3]-bounds[1])*scale,
00369                width_set  = True,
00370                height_set = True)
00371 
00372       if ((index+1)%5 == 0):
00373         self.itemgroup.add(
00374           gnomecanvas.CanvasText,
00375           x=(bounds[2]-bounds[0])/2,
00376           y=-10,
00377           fill_color_rgba=0x000000ffL,
00378           font=gcompris.skin.get_font("gcompris/board/small bold"),
00379           anchor=gtk.ANCHOR_CENTER,
00380           text = index + 1)
00381 


Member Function Documentation

Definition at line 382 of file bargame.py.

00382 
00383     def isBlue(self):
00384       self.ball.set(pixbuf = self.board.pixmap_blue_ball)
00385       bounds = self.ball.get_bounds()
00386       self.ball.set(width  = (bounds[2]-bounds[0])*self.scale,
00387                     height = (bounds[3]-bounds[1])*self.scale,
00388                     width_set  = True,
00389                     height_set = True)
00390       self.ball.show()
00391       self.ombre.show()

Definition at line 392 of file bargame.py.

00392 
00393     def isGreen(self):
00394       self.ball.set(pixbuf = self.board.pixmap_green_ball)
00395       bounds = self.ball.get_bounds()
00396       self.ball.set(width  = (bounds[2]-bounds[0])*self.scale,
00397                     height = (bounds[3]-bounds[1])*self.scale,
00398                     width_set  = True,
00399                     height_set = True)
00400       self.ball.show()
00401       self.ombre.show()
00402 
00403 
  class ball:

Member Data Documentation

Definition at line 354 of file bargame.py.

Definition at line 314 of file bargame.py.

Definition at line 316 of file bargame.py.

Definition at line 342 of file bargame.py.

Definition at line 321 of file bargame.py.


The documentation for this class was generated from the following file: