mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Gestion du overlay sur la fenêtre de documentation
This commit is contained in:
parent
cb55e3b641
commit
f0a77c2a59
BIN
ropy-07.blend
BIN
ropy-07.blend
Binary file not shown.
69
rp.py
69
rp.py
@ -307,7 +307,6 @@ def cmd_init():
|
|||||||
scene.objects['Doc-cmd-Hl'].setVisible(False,False)
|
scene.objects['Doc-cmd-Hl'].setVisible(False,False)
|
||||||
scene.objects['ResetView-Hl'].setVisible(False,False)
|
scene.objects['ResetView-Hl'].setVisible(False,False)
|
||||||
scene.objects['About-cmd-Hl'].setVisible(False,False)
|
scene.objects['About-cmd-Hl'].setVisible(False,False)
|
||||||
scene.objects['About'].setVisible(False,True)
|
|
||||||
|
|
||||||
# UI : Sounds
|
# UI : Sounds
|
||||||
# Read config (sound : data/config/sound -> [0][1].text)
|
# Read config (sound : data/config/sound -> [0][1].text)
|
||||||
@ -463,7 +462,8 @@ def cmd_click (cont):
|
|||||||
# 0 : rien (par défaut)
|
# 0 : rien (par défaut)
|
||||||
# 1 : Pan avec Shift
|
# 1 : Pan avec Shift
|
||||||
# 2 : Zoom avec Ctrl
|
# 2 : Zoom avec Ctrl
|
||||||
# 9 : Fenêtre modal
|
# 8 : Fenêtre Documentation
|
||||||
|
# 9 : Fenêtre About
|
||||||
##
|
##
|
||||||
|
|
||||||
def mode(cont):
|
def mode(cont):
|
||||||
@ -780,19 +780,22 @@ def mouse_down():
|
|||||||
##
|
##
|
||||||
|
|
||||||
def tablet_open ():
|
def tablet_open ():
|
||||||
scene.objects['Terrain']['manip_mode']=9 # Fenêtre modale
|
scene.objects['Terrain']['manip_mode']=8 # Fenêtre modale Aide
|
||||||
manip_reset()
|
manip_reset()
|
||||||
|
|
||||||
# Overlay
|
# Overlay
|
||||||
# scene.objects['Points'].setVisible(False,True)
|
|
||||||
|
|
||||||
# scene.objects['Points-Step-text'].setVisible(False,True)
|
# scene.objects['Points-Step-text'].setVisible(False,True)
|
||||||
# scene.objects['Points-Level-text'].setVisible(False,True)
|
# scene.objects['Points-Level-text'].setVisible(False,True)
|
||||||
# scene.objects['Points-Nbligne-text'].setVisible(False,True)
|
# scene.objects['Points-Nbligne-text'].setVisible(False,True)
|
||||||
# scene.objects['Level'].setVisible(False,True)
|
# scene.objects['Level'].setVisible(False,True)
|
||||||
|
|
||||||
# scene.removeOverlayCollection(bpy.data.collections['Hud'])
|
scene.removeOverlayCollection(bpy.data.collections['Hud'])
|
||||||
# scene.active_camera = scene.objects["Camera-Hud"]
|
scene.objects['Points'].setVisible(False,True)
|
||||||
|
scene.objects['Commands'].setVisible(False,True)
|
||||||
|
scene.active_camera = scene.objects["Camera-Hud"]
|
||||||
|
scene.objects['Camera'].setVisible(False,True)
|
||||||
|
|
||||||
# scene.objects['Sun'].setVisible(False,False)
|
# scene.objects['Sun'].setVisible(False,False)
|
||||||
# scene.objects['Book-cmd'].setVisible(False,False)
|
# scene.objects['Book-cmd'].setVisible(False,False)
|
||||||
# scene.objects['Book-cmd'].suspendPhysics()
|
# scene.objects['Book-cmd'].suspendPhysics()
|
||||||
@ -802,7 +805,7 @@ def tablet_open ():
|
|||||||
# scene.objects['Construc-Hl'].setVisible(False,False)
|
# scene.objects['Construc-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Book-cmd-underlay'].setVisible(True,False)
|
# scene.objects['Book-cmd-underlay'].setVisible(True,False)
|
||||||
|
|
||||||
# Initialisation de la tablette
|
# Ouvrir la tablette
|
||||||
rp_doc.open()
|
rp_doc.open()
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -813,28 +816,39 @@ def tablet_close ():
|
|||||||
|
|
||||||
# Fermeture de la tablette
|
# Fermeture de la tablette
|
||||||
rp_doc.close()
|
rp_doc.close()
|
||||||
scene.objects['Terrain']['manip_mode']=0 # Fenêtre modale
|
scene.objects['Terrain']['manip_mode']=0 # Enlever la fenêtre modale
|
||||||
|
|
||||||
# Overlay
|
# Overlay
|
||||||
# scene.objects['Points'].setVisible(True,True)
|
scene.objects['Points'].setVisible(True,True)
|
||||||
|
scene.objects['Commands'].setVisible(True,True)
|
||||||
|
scene.objects['Camera'].setVisible(True,True)
|
||||||
|
scene.active_camera = scene.objects["Camera"]
|
||||||
|
scene.addOverlayCollection(scene.cameras['Camera-Hud'], bpy.data.collections['Hud'])
|
||||||
|
|
||||||
# scene.objects['Points-Step-text'].setVisible(True,True)
|
# UI : Commands
|
||||||
# scene.objects['Points-Level-text'].setVisible(True,True)
|
scene.objects['Run-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Points-Nbligne-text'].setVisible(True,True)
|
scene.objects['Pause'].setVisible(False,False)
|
||||||
# scene.objects['Level'].setVisible(True,True)
|
scene.objects['Pause'].suspendPhysics()
|
||||||
|
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||||
# scene.active_camera = scene.objects["Camera"]
|
scene.objects['Stop'].setVisible(False,False)
|
||||||
# scene.addOverlayCollection(scene.cameras['Camera-Hud'], bpy.data.collections['Hud'])
|
scene.objects['Stop'].suspendPhysics()
|
||||||
# scene.objects['Sun'].setVisible(True,False)
|
scene.objects['Stop-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Book-cmd'].setVisible(True,False)
|
scene.objects['Distance-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Book-cmd']. restorePhysics()
|
scene.objects['Doc-cmd-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Construc'].setVisible(True,False)
|
scene.objects['ResetView-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Construc']. restorePhysics()
|
scene.objects['About-cmd-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Book-cmd-underlay'].setVisible(False,False)
|
|
||||||
# scene.objects['Construc-underlay'].setVisible(False,False)
|
# UI : Sounds
|
||||||
|
# Read config (sound : data/config/sound -> [0][1].text)
|
||||||
|
if rp_config_tree[0][1].text == "True":
|
||||||
|
sound_set ()
|
||||||
|
else:
|
||||||
|
sound_unset ()
|
||||||
|
# audiodev.unlock()
|
||||||
|
scene.objects['Cmd-text'].setVisible(False,False)
|
||||||
|
|
||||||
##
|
##
|
||||||
# Click pour enteindre la tablette
|
# Clic pour fermer la tablette
|
||||||
##
|
##
|
||||||
|
|
||||||
def tablet_close_click(cont):
|
def tablet_close_click(cont):
|
||||||
@ -853,11 +867,9 @@ color_link_hl = (0.799, 0.617, 0.021, 1) # Jaune
|
|||||||
##
|
##
|
||||||
|
|
||||||
def about_open():
|
def about_open():
|
||||||
scene.objects['Terrain']['manip_mode']=9 # Fenêtre modale
|
scene.objects['Terrain']['manip_mode']=9 # Fenêtre modale About
|
||||||
manip_reset()
|
manip_reset()
|
||||||
# scene.objects['About_title'].color = color_black
|
|
||||||
# scene.objects['About_text'].color = color_black
|
|
||||||
# scene.objects['About_copyright'].color = color_black
|
|
||||||
scene.objects['About_link-git'].color= color_link
|
scene.objects['About_link-git'].color= color_link
|
||||||
scene.objects['About_link-gpl'].color= color_link
|
scene.objects['About_link-gpl'].color= color_link
|
||||||
scene.objects['About_link-upbge'].color= color_link
|
scene.objects['About_link-upbge'].color= color_link
|
||||||
@ -912,7 +924,6 @@ def about_hl(cont):
|
|||||||
|
|
||||||
def about_close():
|
def about_close():
|
||||||
# sound_play (sndbuff_click)
|
# sound_play (sndbuff_click)
|
||||||
print ("about_close():")
|
|
||||||
scene.objects['Terrain']['manip_mode']=0
|
scene.objects['Terrain']['manip_mode']=0
|
||||||
scene.objects['About'].setVisible(False,True)
|
scene.objects['About'].setVisible(False,True)
|
||||||
scene.objects['About'].worldPosition = [42, -2, 3]
|
scene.objects['About'].worldPosition = [42, -2, 3]
|
||||||
|
17
rp_doc.py
17
rp_doc.py
@ -19,19 +19,10 @@ import aud # Sounds
|
|||||||
scene = bge.logic.getCurrentScene()
|
scene = bge.logic.getCurrentScene()
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
# color_doc_chap = (0.153, 0.116, 0.105, 1) # WoodDark
|
|
||||||
# color_doc_fct = (0.326, 0.101, 0.0592, 1) # BrownDark
|
|
||||||
# color_doc_fct = (0.577, 0.233, 0.115, 1) # Brown
|
|
||||||
# color_doc_hl = (0.799, 0.617, 0.021, 1) # Yellow
|
|
||||||
# color_doc_hl = (0.13, 0.254, 0.407, 1) # BlueDark
|
|
||||||
|
|
||||||
color_doc_chap = (0, 1, 0.857,1) # Turquoise
|
color_doc_chap = (0, 1, 0.857,1) # Turquoise
|
||||||
color_doc_fct = (0, 1, 0.857,1) # Turquoise
|
color_doc_fct = (0, 1, 0.857,1) # Turquoise
|
||||||
color_doc_hl = (0.799, 0.617, 0.021, 1) # Jaune
|
color_doc_hl = (0.799, 0.617, 0.021, 1) # Jaune
|
||||||
color_doc_activate = (0.936, 0.033, 1, 1) # Rose
|
color_doc_activate = (0.936, 0.033, 1, 1) # Rose
|
||||||
# color_doc_activate = (1, 0.099, 0.981, 1) # Rose
|
|
||||||
|
|
||||||
# scene.objects['Doc_icon_'+name_chap+'-text'].color = color_doc_activate
|
|
||||||
|
|
||||||
# Sounds
|
# Sounds
|
||||||
# audiodev = aud.Device()
|
# audiodev = aud.Device()
|
||||||
@ -250,14 +241,6 @@ def open():
|
|||||||
else:
|
else:
|
||||||
scene.objects['Doc_title'].setVisible(False,True)
|
scene.objects['Doc_title'].setVisible(False,True)
|
||||||
scene.objects['Doc_text'].setVisible(False,True)
|
scene.objects['Doc_text'].setVisible(False,True)
|
||||||
|
|
||||||
# Placer la page Généralité (page par défaut)
|
|
||||||
# scene.objects['Doc_chap-general'].worldPosition = scene.objects['Doc'].worldPosition
|
|
||||||
# scene.objects['Doc_chap-general'].setVisible(True,True)
|
|
||||||
# scene.objects['Doc']['page_chap'] = "general"
|
|
||||||
# scene.objects['Doc-general'].color = color_doc_activate
|
|
||||||
# scene.objects['Doc-general-text'].color = color_doc_activate
|
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Fermeture du livre
|
# Fermeture du livre
|
||||||
|
Loading…
Reference in New Issue
Block a user