コード例 #1
0
ファイル: user_interface_0.py プロジェクト: origliante/hgw
 def __init__(self,eth0ImgReceiver,xmlrpc_server):
     self._curVideoReceiver = eth0ImgReceiver
     self._curVideoReceiverStatus = 0
     self._curXmlrpc_server = xmlrpc_server
     self._curpath = os.path.dirname(sys.argv[0])   
     self._clock = pygame.time.Clock()
     self._main_screen = pygame.display.set_mode((MAXX, MAXY),pygame.NOFRAME )
     self._doorcamera_rect = pygame.Rect(0,0,MAXX,MAXY)
     gui.init(myscreen = self._main_screen)
     self._app = gui.App("netcarity",width = MAXX, height = MAXY)
     self._btnReset = gui.Button("reset          ", x=20, y=110)
     self._btnGetTemp = gui.Button("get_temp  ", x=20, y=150)
     self._btnSendTemp = gui.Button("send_temp", x=20, y=190)
     self._btnOpenVideo = gui.Button("video_on", x=20, y=230)
     self._btnCloseVideo = gui.Button("video_off", x=20, y=270)
     self.video_surface = pygame.Surface((VIDEOMAXX,VIDEOMAXY))
     self._app.add(self._btnReset,self._btnGetTemp,self._btnSendTemp,self._btnOpenVideo,self._btnCloseVideo)
     self._btnReset.connect(CLICK,self.click_button1)
     self._btnOpenVideo.connect(CLICK,self.click_startvideo)
     self._btnCloseVideo.connect(CLICK,self.click_stopvideo)
     threading.Thread.__init__(self)
コード例 #2
0
ファイル: example1.py プロジェクト: zenki2001cn/SnippetCode
"""
This example is to demonstrate GooeyPy's widgets and functionality.
"""

import sys
sys.path.insert(0, "..")

import gooeypy as gui
import pygame
from gooeypy.const import *

# Our clock.
clock = pygame.time.Clock()

# Lets initialize the GUI.
gui.init(640, 480)

# Our base GUI widget, the mighty App!
app = gui.App(width=640, height=480)

# Create some widgets (if any of this is confusing, just read the docs for the
# widget).
w1 = gui.Button("reset", x=20, y=30)
w2 = gui.Input(x=100, y=30, width=240)
w3 = gui.Switch(x=500, y=30)
w4 = gui.HSlider(min_value=20, length=10, x=200, y=160)
w9 = gui.VSlider(length=40, x=600, y=160, step=False)
l1 = gui.Label(value="Pulsate:", x=395, y=30, font_size=25)

data = """This example is to demonstrate GooeyPy's widgets and functionality.
コード例 #3
0
ファイル: example2.py プロジェクト: zenki2001cn/SnippetCode
import sys

sys.path.insert(0, "..")

import pygame
import gooeypy as gui
from gooeypy.const import *

clock = pygame.time.Clock()

# Here is our screen that we are already using in our game.
screen = pygame.display.set_mode((640, 480))

# Here is one thing we do different. We pass it our own surface that we want it
# to use. This way, it won't set the display.
gui.init(myscreen=screen)

app = gui.App(width=640, height=100)


# Lets create a very simple game where you move around an image.
image = gui.get_image("image.png")
x = 200
y = 250


tb = gui.TextBlock(
    value="This example is for demonstrating how you can easily use GooeyPy in your already made game.",
    align="center",
    y=20,
    width=350,