Initiale Kameraposition angepasst-
This commit is contained in:
52
SnakeTest.py
52
SnakeTest.py
@@ -253,15 +253,7 @@ def main():
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
from math import pi, sin, cos
|
||||
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.task import Task
|
||||
from direct.actor.Actor import Actor
|
||||
from direct.interval.IntervalGlobal import Sequence
|
||||
from panda3d.core import Point3
|
||||
from panda3d.core import WindowProperties
|
||||
from panda3d.core import Loader
|
||||
|
||||
|
||||
|
||||
@@ -280,11 +272,19 @@ from panda3d.core import Loader
|
||||
# {"walk": "models/panda-walk4"})
|
||||
# self.pandaActor.reparentTo(self.render)
|
||||
|
||||
|
||||
|
||||
#game = Game()
|
||||
#game.run()
|
||||
|
||||
|
||||
from math import pi, sin, cos
|
||||
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.task import Task
|
||||
from direct.actor.Actor import Actor
|
||||
from direct.interval.IntervalGlobal import Sequence
|
||||
from panda3d.core import Point3
|
||||
from panda3d.core import WindowProperties
|
||||
from panda3d.core import Loader
|
||||
from direct.showbase.ShowBase import ShowBase #Grundmodul zum Starten eines Fenster mit Grundszene
|
||||
from direct.gui.OnscreenText import OnscreenText #Ermöglicht die direkte Einblendung von Texten
|
||||
from direct.gui.DirectGui import * #Ermöglicht das Einblenden von Menüs und deren Manipulation
|
||||
@@ -352,7 +352,7 @@ class MyApp(ShowBase):
|
||||
#Erstellt ein DialogFenster
|
||||
self.gameOverScreen = DirectDialog(frameSize = (-0.7, 0.7, -0.7, 0.7),
|
||||
fadeScreen = 0.4,
|
||||
relief = DGG.FLAT, frameTexture= "data/panda_example/UI/stoneFrame.png")
|
||||
relief = DGG.FLAT, frameTexture= "data/drawing_raw/mainmenu.png")
|
||||
|
||||
#Erstellt einen Button zum Parent-Dialogfenster
|
||||
self.btn = DirectButton(text = "Quit",
|
||||
@@ -382,10 +382,25 @@ class MyApp(ShowBase):
|
||||
#self.taskMgr.doMethodLater(0.8,self.exampleTask, "exampleTask") #Hängt einen zustäzlichen Task in den Taskmanager ein
|
||||
|
||||
self.gameOverScreen.show()
|
||||
|
||||
# Create scene 1
|
||||
self.scene1_background = self.loader.loadModel("data/panda_example/Environment/environment")
|
||||
self.scene1_background.reparentTo(self.render)
|
||||
# Set Camera-Position (initial)
|
||||
self.scene1_background.setPos(0, 32, 0) # (X, Z, Y)
|
||||
self.scene1_background.setP(90)
|
||||
|
||||
|
||||
#self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")
|
||||
|
||||
def spinCameraTask(self, task):
|
||||
angleDegrees = task.time * 6.0
|
||||
angleRadians = angleDegrees * (pi / 180.0)
|
||||
self.camera.setPos(20 * sin(angleRadians), -20 * cos(angleRadians), 3)
|
||||
self.camera.setHpr(angleDegrees, 20, 0)
|
||||
return Task.cont
|
||||
"""
|
||||
# Create scene 1
|
||||
|
||||
|
||||
self.scene1 = self.render.attachNewNode("Scene 1")
|
||||
self.scene1_text = OnscreenText(text="Scene 1", pos=(0, 0), scale=0.1, align=TextNode.ACenter)
|
||||
if(us.checkuserdb() == False):
|
||||
@@ -403,20 +418,11 @@ class MyApp(ShowBase):
|
||||
|
||||
# Set initial scene
|
||||
self.current_scene = 1
|
||||
|
||||
"""
|
||||
# Set key bindings
|
||||
self.accept('space', self.toggle_scene)
|
||||
self.accept('escape', self.quit)
|
||||
|
||||
# Position and orient the camera
|
||||
self.camera.setPos(0, -10, 0) # Set camera position
|
||||
self.camera.lookAt(0, 0, 0) # Point camera towards the origin
|
||||
"""
|
||||
for i in range(5):
|
||||
time.sleep(3)
|
||||
label_menu['text'] = "WOSCHT" + str(i)"""
|
||||
|
||||
|
||||
def toggle_scene(self):
|
||||
if self.current_scene == 1:
|
||||
self.scene1_text.hide()
|
||||
|
||||
BIN
data/drawing_raw/mainmenu.png
Normal file
BIN
data/drawing_raw/mainmenu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
104
data/drawing_raw/mainmenu.svg
Normal file
104
data/drawing_raw/mainmenu.svg
Normal file
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="210mm"
|
||||
height="297mm"
|
||||
viewBox="0 0 210 297"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.3.2 (091e20e, 2023-11-25)"
|
||||
sodipodi:docname="mainmenu.svg"
|
||||
inkscape:export-filename="mainmenu.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="2"
|
||||
inkscape:cx="314.75"
|
||||
inkscape:cy="266"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1356"
|
||||
inkscape:window-x="2560"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1"
|
||||
showguides="false" />
|
||||
<defs
|
||||
id="defs1">
|
||||
<rect
|
||||
x="198.34345"
|
||||
y="128.69343"
|
||||
width="282.48916"
|
||||
height="56.568542"
|
||||
id="rect16" />
|
||||
<clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath33">
|
||||
<rect
|
||||
style="fill:#000000;stroke:none;stroke-width:0.999995;stroke-linecap:butt;stroke-linejoin:bevel;paint-order:stroke markers fill;stop-color:#000000"
|
||||
id="rect33"
|
||||
width="46.19186"
|
||||
height="80.006783"
|
||||
x="74.999985"
|
||||
y="399.99661" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
id="swatch9"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#8ee5ad;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop9" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
style="stop-color:#a2c3eb;stop-opacity:0.89565217;"
|
||||
offset="0"
|
||||
id="stop1" />
|
||||
<stop
|
||||
style="stop-color:#e5c38e;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop2" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1"
|
||||
id="linearGradient2"
|
||||
x1="143.83818"
|
||||
y1="179.36238"
|
||||
x2="242.05215"
|
||||
y2="245.88319"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.95430039,0,0,0.91769675,-7.6441061,-30.427863)" />
|
||||
</defs>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
id="rect1"
|
||||
style="fill:url(#linearGradient2);stroke:#bbbbbb;stroke-width:2.68955;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
|
||||
d="m 39.218653,149.99294 c 34.34412,0 68.688247,0 103.032357,0 0,-43.20071 0,-86.401414 0,-129.60212 -34.38087,0 -68.761759,0 -103.14264,0 0.03676,43.200706 0.07352,86.40141 0.110283,129.60212 z" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
transform="scale(0.26458333)"
|
||||
id="text16"
|
||||
style="fill:#8ee5ad;fill-opacity:1;stroke:#bbbbbb;stroke-opacity:1;stroke-width:6.25133858;stroke-dasharray:none;paint-order:markers stroke fill;stroke-linejoin:bevel;stroke-linecap:butt;opacity:1;white-space:pre;shape-inside:url(#rect16)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user