Menü rendszer
This commit is contained in:
@@ -1,14 +1,25 @@
|
||||
import arcade
|
||||
import assets
|
||||
import controls
|
||||
import menu
|
||||
import text
|
||||
import renderers
|
||||
|
||||
text = text.TextRenderer(6, 186, 210)
|
||||
panel = renderers.NineSlicesPanel(0,100,230,100)
|
||||
|
||||
m = []
|
||||
|
||||
def switch():
|
||||
pass
|
||||
global m
|
||||
m = [
|
||||
menu.MenuItem("1", 100, 90, None, None, None, None, None, None),
|
||||
menu.MenuItem("2", 100, 70 , None, None, None, None, None, None)
|
||||
]
|
||||
|
||||
m[0].down = m[1]
|
||||
m[1].up = m[0]
|
||||
m[0].select()
|
||||
|
||||
def update(dt):
|
||||
controltext = ""
|
||||
@@ -16,6 +27,8 @@ def update(dt):
|
||||
for c in controls.controls:
|
||||
controltext += f"{c.label}: {c.pressed}-{c.held}\n"
|
||||
|
||||
for i in m:
|
||||
i.update()
|
||||
text.reset(controltext)
|
||||
text.type_all()
|
||||
|
||||
@@ -24,6 +37,8 @@ def draw(game):
|
||||
arcade.LBWH(0, 0, game.screen_width, game.screen_height),
|
||||
arcade.color.RED,
|
||||
)
|
||||
for i in m:
|
||||
i.render()
|
||||
|
||||
panel.render()
|
||||
text.render()
|
||||
Reference in New Issue
Block a user