示例#1
0
文件: interface.py 项目: jggatc/nexus
from __future__ import division
import env
engine = env.engine

import interphase
interphase.init(engine)


class MatrixInterface(interphase.Interface):
    def __init__(self, identity, matrix, control):
        self.matrix = matrix
        self.control = control
        interphase.Interface.__init__(self,
                                      identity,
                                      position=(self.matrix.width // 2,
                                                self.matrix.height - 50),
                                      color=(15, 30, 50),
                                      size=(200, 100),
                                      control_minsize=(35, 35),
                                      control_size='auto',
                                      control_response=100,
                                      moveable=False,
                                      position_offset=(0, 98),
                                      font_color=(50, 150, 200),
                                      scroll_button='vertical')
        self.get_control('Activate').set_active(False)

    def add_controls(self):
        self.add(identity='Control',
                 control_type='function_toggle',
                 position=(100, 90),
示例#2
0
文件: demo.py 项目: jggatc/interphase
#Released under the MIT License <http://opensource.org/licenses/MIT>
#
#"""
#Interphase Demo
#
#Interphase Module
#Project Site: http://gatc.ca/
#"""

from __future__ import division
import os
import random
import pygame as engine
import interphase

interphase.init(engine)


module_info = """Interphase Module\n\nThe module adds interface panel functionality to a Pygame application. It was developed as a simple GUI with the goal to simulate a digital display panel. The module provides interface and control objects to design a panel, with methods to manage the panel from the application code."""


class InterfaceDemo(interphase.Interface):
    """
    Interphase interface.
    """

    def __init__(self):
        self.screen, self.background, self.clock = self.initiate()
        interphase.Interface.__init__(self, position=(self.screen.get_width()//2,self.screen.get_height()-50), color=(43,50,58), size=(350,100), moveable=False, position_offset=(0,95), control_minsize=(25,25), control_size='auto', font_color=(175,180,185), tips_fontcolor=(175,180,185), scroll_button='both')
        self.puzzle = False
        self.puzzle_init = False
示例#3
0
import os, sys, math, random
if os.name in ('posix', 'nt', 'os2', 'ce', 'riscos'):
    import pygame
    platform = 'pc'
elif os.name == 'java':
    import pyj2d
    sys.modules['pygame'] = pyj2d
    pygame = pyj2d
    platform = 'jvm'
else:
    import pyjsdl as pygame
    platform = 'js'

try:
    import interphase as interphase
    interphase.init(pygame)
except ImportError:
    print('Interphase module not found.')
    interphase = None

import env
env.engine = pygame
env.interface = interphase
env.platform = platform
env.size = 8
env.color0 = pygame.Color(0,0,0)
env.color1 = pygame.Color(0,255,0)

from control import Control
if interphase:
    from interface import MatrixInterface