Fixed up some paths and added a test image.
This commit is contained in:
parent
955a3db31f
commit
5c9b721567
3 changed files with 5 additions and 3 deletions
BIN
img/wrench.png
Normal file
BIN
img/wrench.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
|
|
@ -3,3 +3,4 @@ import os
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
SCREENSHOT_DIR = os.path.join(PROJECT_ROOT, 'screenshots')
|
SCREENSHOT_DIR = os.path.join(PROJECT_ROOT, 'screenshots')
|
||||||
|
IMG_DIR = os.path.join(PROJECT_ROOT, 'img')
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
from jgui.surface import Surface, Window, Position, Size, Color, TextWindow, ImageWindow
|
from jgui.surface import Surface, Window, Position, Size, Color, TextWindow, ImageWindow
|
||||||
import math
|
import math, os
|
||||||
|
from jgui.settings import IMG_DIR
|
||||||
|
|
||||||
class TestSurface(Surface):
|
class TestSurface(Surface):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
@ -17,7 +18,7 @@ class TestSurface(Surface):
|
||||||
background_color=(1,1,1),
|
background_color=(1,1,1),
|
||||||
clip_children=True,
|
clip_children=True,
|
||||||
ignore_debug=True,
|
ignore_debug=True,
|
||||||
background_image='/home/joey/Pictures/wrench.png',
|
background_image=os.path.join(IMG_DIR, 'wrench.png'),
|
||||||
background_image_filter='bilinear')
|
background_image_filter='bilinear')
|
||||||
|
|
||||||
my_win.add_child(TextWindow('text','Micro Bean is the best bean ever.',
|
my_win.add_child(TextWindow('text','Micro Bean is the best bean ever.',
|
||||||
|
|
@ -30,7 +31,7 @@ class TestSurface(Surface):
|
||||||
self.root_window.add_child(TestWindow('child2', position=[200,200],
|
self.root_window.add_child(TestWindow('child2', position=[200,200],
|
||||||
size=[200,200], draggable=True))
|
size=[200,200], draggable=True))
|
||||||
|
|
||||||
self.root_window.add_child(ImageWindow('image', image_path='/home/joey/Pictures/wrench.png',
|
self.root_window.add_child(ImageWindow('image', image_path=os.path.join(IMG_DIR, 'wrench.png'),
|
||||||
position=[0,200], size=[200,200],
|
position=[0,200], size=[200,200],
|
||||||
draggable=True, resizable=True))
|
draggable=True, resizable=True))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue