Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(31)  |  Call(20)  |  Derive(0)  |  Import(11)
This class represents images that are loaded from files for the UI.  As added functionality, it can respond to mouse motion and mouse pressed events (hence the active part)
Fields:
image = the image that is displayed
mouse_moved_action = the action that is called whenever a mouse moved event occures
mouse_pressed_action = the action that is called whenever a mouse pressed event occurs

src/c/o/corvec-HEAD/Game/gui/MatchPlay_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Component import Component, nothing
from Active_Image import Active_Image
import Game_Files
	def __construct_screen_image(self):
		"""Constructs and displays the imageMINI_GAME_BUTTONS_HEIGHT_RATIO at the top of the panel"""
		width, height = self.size
		height = (int)(height * HEADER_HEIGHT_RATIO)
		image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(IMAGE_NAME))
			im_dir, action = self.button_setup[c]
			position = (0,start_at + button_height*c)
			current = Active_Image(position, (button_width, button_height), im_dir, nothing, action)
			self.add_component(current, True)
 
		back_pos = (2*button_width, (int)(height*(HEADER_HEIGHT_RATIO + MINI_GAME_BUTTONS_HEIGHT_RATIO)))
 
		start_button = Active_Image(start_pos, (button_width, button_height), start_dir, nothing, self.__action_start)
		delete_button = Active_Image(delete_pos, (button_width, button_height), delete_dir, nothing, self.__action_delete)
		back_button = Active_Image(back_pos, (button_width, button_height), back_dir, nothing, self.__action_back)

src/c/o/corvec-HEAD/Game/gui/Main_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Button import Button
from Component import Component, nothing
from Active_Image import Active_Image
	def __construct_screen_image(self):
		"""Constructs and displays the image at the top of the panel"""
		width, height = self.size
		height = (int)(height * IMAGE_BUTTON_RATIO)
		image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(IMAGE_NAME))
			if c == 0:#The button is the first player button
				position = (0,start_at + button_height*c)
				current = Active_Image(position, (button_width/2, button_height*2), im_dir, nothing, action)
			elif c == 1:#The button is the second player button
				position = (button_width/2,start_at + button_height*(c-1))
				current = Active_Image(position, (button_width/2, button_height*2), im_dir, nothing, action)
			else:
				position = (0,start_at + button_height*c)
				current = Active_Image(position, (button_width, button_height), im_dir, nothing, action)

src/c/o/corvec-HEAD/Game/gui/QuickPlay_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Button import Button
from Component import Component, nothing
from Active_Image import Active_Image
	def __construct_screen_image(self):
		"""Constructs and displays the image at the top of the panel"""
		width, height = self.size
		height = (int)(height * IMAGE_BUTTON_RATIO)
		image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(IMAGE_NAME))
			im_dir, action = self.button_setup[c]
			position = (0,start_at + button_height*c)
			current = Active_Image(position, (button_width, button_height), im_dir, nothing, action)
			self.add_component(current, True)
 

src/c/o/corvec-HEAD/Game/gui/old_gui/Tile_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Button import Button
from Component import Component
from Active_Image import Active_Image
		y_start = (int)((height - tile_height)/2)
		for c in range(option_count):
			i = Active_Image( (x + x_start + c * tile_width, y + y_start), (tile_width, tile_height),options[c][0], when_mouse_over_action, when_mouse_pressed_action)
			i.data = options[c]
			self.add_component(i, True)

src/c/o/corvec-HEAD/Game/gui/old_gui/Selection_Sub_Panel.py   I'm Corvec(Download)
import pygame
from pygame.locals import *
from Component import Component, nothing
from Option_Display import Option_Display
from Active_Image import Active_Image
		y_start = (int)((height - tile_height)/2)
		for c in range(option_count):
			i = Active_Image( (x + x_start + c * tile_width, y + y_start), (tile_width, tile_height),options[c][0],  self._action_update_display, self.nothing)
			i.data = options[c]
			self.add_component(i, True)

src/c/o/corvec-HEAD/Game/gui/Connect_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Button import Button
from Component import Component, nothing
from Active_Image import Active_Image
	def __construct_screen_image(self, player):
		"""Constructs and displays the image at the top of the panel"""
		width, height = self.size
		if player == 0:
			image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(P1_IMAGE_NAME))
		else:
			image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(P2_IMAGE_NAME))

src/c/o/corvec-HEAD/Game/gui/old_gui/Option_Display.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Component import Component, nothing
from Active_Image import Active_Image
from Text_Area import Text_Area
		description = ""
 
		self.display = Active_Image( (x1, y1), image_size, image)
		self.description = Text_Area( (x2, y2), description_size, description, (int)(height/LINES), False, -1, True)
 

src/c/o/corvec-HEAD/Game/gui/old_gui/Options_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Button import Button
from Component import Component, nothing
from Active_Image import Active_Image
	def _construct_screen_image(self):
		"""Constructs and displays the image at the top of the panel"""
		width, height = self.size
		height = (int)(height * IMAGE_BUTTON_RATIO)
		image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(IMAGE_NAME))

src/c/o/corvec-HEAD/Game/gui/old_gui/Main_Panel.py   I'm Corvec(Download)
import pygame, sys
from pygame.locals import *
from Button import Button
from Component import Component, nothing
from Active_Image import Active_Image
	def _construct_screen_image(self):
		"""Constructs and displays the image at the top of the panel"""
		width, height = self.size
		height = (int)(height * IMAGE_BUTTON_RATIO)
		image = Active_Image(self.position, (width, height), Game_Files.get_menu_image_location(IMAGE_NAME))

src/c/o/corvec-HEAD/Game/gui/old_gui/Failure_Panel.py   I'm Corvec(Download)
import pygame
from pygame.locals import *
from Component import Component, nothing
from Duel_Continuation_Panel import Duel_Continuation_Panel
from Active_Image import Active_Image
		height = (int)(height *(1 - BOTTOM_AREA_RATIO))		
 
		image = Active_Image(position, (width, height), Game_Files.get_menu_image_location(IMAGE_NAME))
		self.add_component(image, False)		
 

  1 | 2  Next