-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
133 changed files
with
168 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
""" | ||
This file shows the smallest working LUI example, on which you can base your | ||
LUI projects. | ||
""" | ||
|
||
# Add lui modules to the path. This will not be required when LUI is included | ||
# in panda. | ||
import sys | ||
sys.path.insert(0, "../Builtin") | ||
|
||
# Load some required LUI classes | ||
from panda3d.lui import LUIRegion, LUIInputHandler | ||
|
||
# Load a builtin LUI class. When lui is included in panda, this will be | ||
# from direct.luiwidgets.LUIButton import LUIButton | ||
from LUIButton import LUIButton | ||
from LUISkin import LUIDefaultSkin | ||
|
||
# Setup panda, nothing special here | ||
from panda3d.core import load_prc_file_data | ||
load_prc_file_data("", """ | ||
text-minfilter linear | ||
text-magfilter linear | ||
text-pixels-per-unit 32 | ||
sync-video #f | ||
textures-power-2 none | ||
show-frame-rate-meter #t | ||
win-size 700 600 | ||
window-title LUI Minimal Example | ||
""") | ||
|
||
from direct.showbase.ShowBase import ShowBase | ||
|
||
class Application(ShowBase): | ||
|
||
def __init__(self): | ||
ShowBase.__init__(self) | ||
|
||
# Construct a new LUIRegion | ||
region = LUIRegion.make("LUI", base.win) | ||
|
||
# Construct a new InputHandler to catch and process events | ||
handler = LUIInputHandler() | ||
base.mouseWatcher.attach_new_node(handler) | ||
region.set_input_handler(handler) | ||
|
||
# Load the default LUI skin | ||
skin = LUIDefaultSkin() | ||
skin.load() | ||
|
||
# LUI is initialized now, so we can start adding elements, for example: | ||
button = LUIButton(parent=region.root, text="Hello world!", top=30, left=30) | ||
|
||
Application().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
This directory contains various LUI demos. You should start with the demos | ||
01 and 02. | ||
|
||
After that, you can try out the demos starting with B_, showing builtin | ||
LUI components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
|
||
cd res | ||
ppython ../../../Misc/LUIAtlasGen.py | ||
pause |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
|
||
import sys | ||
sys.path.insert(0, "../Builtin") | ||
|
||
from direct.showbase.ShowBase import ShowBase | ||
from direct.showbase.DirectObject import DirectObject | ||
|
||
from panda3d.core import * | ||
load_prc_file_data("", """ | ||
text-minfilter linear | ||
text-magfilter linear | ||
text-pixels-per-unit 32 | ||
sync-video #f | ||
textures-power-2 none | ||
notify-level-lui info | ||
show-frame-rate-meter #t | ||
win-size 780 630 | ||
window-title LUI Demo | ||
win-fixed-size #f | ||
""") | ||
|
||
from panda3d.lui import LUIRegion, LUIObject, LUIInputHandler, LUISprite, LUIVerticalLayout | ||
from LUISkin import LUIDefaultSkin | ||
from LUIFrame import LUIFrame | ||
from LUIFormattedLabel import LUIFormattedLabel | ||
from LUIInputField import LUIInputField | ||
from LUIButton import LUIButton | ||
from LUILabel import LUILabel | ||
from LUICheckbox import LUICheckbox | ||
from LUIRadiobox import LUIRadiobox | ||
from LUIRadioboxGroup import LUIRadioboxGroup | ||
|
||
s = ShowBase() | ||
base.win.set_clear_color(Vec4(0.05, 0.05, 0.05, 1.0)) | ||
|
||
skin = LUIDefaultSkin() | ||
skin.load() | ||
|
||
region = LUIRegion.make("LUI", base.win) | ||
handler = LUIInputHandler() | ||
base.mouseWatcher.attach_new_node(handler) | ||
region.set_input_handler(handler) | ||
|
||
# bg = LUISprite(region.root, "blank", "skin") | ||
# bg.pos = 200, 200 | ||
# bg.size = 200, 300 | ||
|
||
container = LUIFrame( | ||
parent = region.root, pos = (200, 200), height=300, | ||
style = LUIFrame.FS_sunken) | ||
|
||
|
||
# label_tl = LUILabel(parent=container, text="Top Left", top_left=(0,0)) | ||
# label_tr = LUILabel(parent=container, text="Top Right", top_right=(0,0)) | ||
# label_bl = LUILabel(parent=container, text="Bottom Left", bottom_left=(0,0)) | ||
# label_br = LUILabel(parent=container, text="Bottom Right", bottom_right=(0,0)) | ||
|
||
# button = LUIButton(parent=container, top_left=(0, 0), text="Well this one .. is a long button! (A really long one!) ............ really long!") | ||
# button.bind("click", lambda event: button.set_text("Hello!")) | ||
container.size = 300, 300 | ||
# group = LUIRadioboxGroup() | ||
# box = LUIRadiobox(parent=container, group=group, top=50) | ||
# box2 = LUICheckbox(parent=container, top=100) | ||
|
||
layout = LUIVerticalLayout(parent=container) | ||
# layout.height = 280 | ||
# layout.width = 300 | ||
|
||
LUILabel(parent=layout.cell(), text="Hello") | ||
LUILabel(parent=layout.cell(), text="World") | ||
LUILabel(parent=layout.cell(100), text="100px row") | ||
LUILabel(parent=layout.cell(), text="Next") | ||
LUIButton(parent=layout.cell(), text="SomeButton") | ||
LUILabel(parent=layout.cell('*'), text="Fill column") | ||
LUILabel(parent=layout.cell(), text="Last column") | ||
|
||
for i in range(5): | ||
base.graphicsEngine.render_frame() | ||
|
||
region.root.ls() | ||
|
||
s.run() |