mirror of
https://forge.apps.education.fr/blender-edutech/lecteur-3d-cinematique.git
synced 2024-01-27 09:43:12 +01:00
Invisibilisation des boutons < et > en fonction de la taille de l'écran
This commit is contained in:
parent
5b3f8baf6f
commit
fb5245656b
BIN
baton_colle/__pycache__/batoncolle.cpython-39.pyc
Normal file
BIN
baton_colle/__pycache__/batoncolle.cpython-39.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
baton_colle/baton_colle-14.blend1
Normal file
BIN
baton_colle/baton_colle-14.blend1
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_about.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_about.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_config.xml
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_config.xml
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_doc.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_doc.py
|
111
cine_about.py
111
cine_about.py
@ -44,6 +44,20 @@ def open():
|
|||||||
|
|
||||||
scene.objects['About'].setVisible(True,True)
|
scene.objects['About'].setVisible(True,True)
|
||||||
|
|
||||||
|
# Boutons < et > ("640x360", "960x540", "1280x720", "1920x1080")
|
||||||
|
if bge.render.getWindowWidth() <=640:
|
||||||
|
scene.objects['About_screen-down'].setVisible(False,True)
|
||||||
|
scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_screen-down'].setVisible(True,True)
|
||||||
|
scene.objects['About_screen-down-colbox'].restorePhysics()
|
||||||
|
if bge.render.getWindowWidth() >= 1920:
|
||||||
|
scene.objects['About_screen-up'].setVisible(False,True)
|
||||||
|
scene.objects['About_screen-up-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
|
scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
def close(cont):
|
def close(cont):
|
||||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
if scene.objects['About']['anim'] == True:
|
if scene.objects['About']['anim'] == True:
|
||||||
@ -101,6 +115,40 @@ def get_near_pos(array,value):
|
|||||||
idx = (np.abs(array-value)).argmin()
|
idx = (np.abs(array-value)).argmin()
|
||||||
return idx
|
return idx
|
||||||
|
|
||||||
|
|
||||||
|
# def about_screen_up(cont):
|
||||||
|
# if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
# screen_width_mode=[640, 960, 1280, 1920]
|
||||||
|
# screen_height_mode=[360, 540, 720,1080]
|
||||||
|
# screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
||||||
|
# i = get_near_pos(screen_width_mode, bge.render.getWindowWidth())
|
||||||
|
# if i>=0 and i<3 :
|
||||||
|
# screen_width=screen_width_mode[i+1]
|
||||||
|
# screen_height=screen_height_mode[i+1]
|
||||||
|
# scene.objects['About_screen']['Text']= "SCREEN SIZE : "+str(screen_width) +" x "+str(screen_height)
|
||||||
|
# bge.render.setWindowSize(screen_width,screen_height)
|
||||||
|
|
||||||
|
# # Boutons < et >
|
||||||
|
# if screen_width <=640:
|
||||||
|
# scene.objects['About_screen-down'].setVisible(False,True)
|
||||||
|
# scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
||||||
|
# else:
|
||||||
|
# scene.objects['About_screen-down'].setVisible(True,True)
|
||||||
|
# scene.objects['About_screen-down-colbox'].restorePhysics()
|
||||||
|
# if screen_width >= 1920:
|
||||||
|
# scene.objects['About_screen-up'].setVisible(False,True)
|
||||||
|
# scene.objects['About_screen-up-colbox'].suspendPhysics (True)
|
||||||
|
# else:
|
||||||
|
# scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
|
# scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
# # Maj du fichier de config (screen size : data/config/screen/width-> [0][3][0].text)
|
||||||
|
# rp_config_tree[0][3][0].text=str(screen_width)
|
||||||
|
# rp_config_tree[0][3][1].text=str(screen_height)
|
||||||
|
# buffer_xml = ET.tostring(rp_config_tree)
|
||||||
|
# with open("rp_config.xml", "wb") as f:
|
||||||
|
# f.write(buffer_xml)
|
||||||
|
|
||||||
# Taille de l'écran +
|
# Taille de l'écran +
|
||||||
def screen_up(cont):
|
def screen_up(cont):
|
||||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
@ -114,6 +162,54 @@ def screen_up(cont):
|
|||||||
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
||||||
bge.render.setWindowSize(screen_width,screen_height)
|
bge.render.setWindowSize(screen_width,screen_height)
|
||||||
|
|
||||||
|
# Boutons < et >
|
||||||
|
if screen_width <=640:
|
||||||
|
scene.objects['About_screen-down'].setVisible(False,True)
|
||||||
|
scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_screen-down'].setVisible(True,True)
|
||||||
|
scene.objects['About_screen-down-colbox'].restorePhysics()
|
||||||
|
if screen_width >= 1920:
|
||||||
|
scene.objects['About_screen-up'].setVisible(False,True)
|
||||||
|
scene.objects['About_screen-up-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
|
scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
|
||||||
|
# def about_screen_down(cont):
|
||||||
|
# if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
# screen_width_mode=[640, 960, 1280, 1920]
|
||||||
|
# screen_height_mode=[360, 540, 720,1080]
|
||||||
|
# screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
||||||
|
# i = get_near_pos(screen_width_mode, bge.render.getWindowWidth())
|
||||||
|
# if i>0 and i<=3 :
|
||||||
|
# screen_width=screen_width_mode[i-1]
|
||||||
|
# screen_height=screen_height_mode[i-1]
|
||||||
|
# scene.objects['About_screen']['Text']= "SCREEN SIZE : "+str(screen_width) +" x "+str(screen_height)
|
||||||
|
# bge.render.setWindowSize(screen_width,screen_height)
|
||||||
|
|
||||||
|
# # Boutons < et >
|
||||||
|
# if screen_width <=640:
|
||||||
|
# scene.objects['About_screen-down'].setVisible(False,True)
|
||||||
|
# scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
||||||
|
# else:
|
||||||
|
# scene.objects['About_screen-down'].setVisible(True,True)
|
||||||
|
# scene.objects['About_screen-down-colbox'].restorePhysics()
|
||||||
|
# if screen_width >= 1920:
|
||||||
|
# scene.objects['About_screen-up'].setVisible(False,True)
|
||||||
|
# scene.objects['About_screen-up-colbox'].suspendPhysics (True)
|
||||||
|
# else:
|
||||||
|
# scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
|
# scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
# # Maj du fichier de config (screen size : data/config/screen/width-> [0][3][0].text)
|
||||||
|
# rp_config_tree[0][3][0].text=str(screen_width)
|
||||||
|
# rp_config_tree[0][3][1].text=str(screen_height)
|
||||||
|
# buffer_xml = ET.tostring(rp_config_tree)
|
||||||
|
# with open("rp_config.xml", "wb") as f:
|
||||||
|
# f.write(buffer_xml)
|
||||||
|
|
||||||
# Taille de l'écran -
|
# Taille de l'écran -
|
||||||
def screen_down(cont):
|
def screen_down(cont):
|
||||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
@ -126,3 +222,18 @@ def screen_down(cont):
|
|||||||
screen_height=screen_height_mode[i-1]
|
screen_height=screen_height_mode[i-1]
|
||||||
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
||||||
bge.render.setWindowSize(screen_width,screen_height)
|
bge.render.setWindowSize(screen_width,screen_height)
|
||||||
|
|
||||||
|
# Boutons < et >
|
||||||
|
if screen_width <=640:
|
||||||
|
scene.objects['About_screen-down'].setVisible(False,True)
|
||||||
|
scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_screen-down'].setVisible(True,True)
|
||||||
|
scene.objects['About_screen-down-colbox'].restorePhysics()
|
||||||
|
if screen_width >= 1920:
|
||||||
|
scene.objects['About_screen-up'].setVisible(False,True)
|
||||||
|
scene.objects['About_screen-up-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
|
scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_about.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_about.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_config.xml
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_config.xml
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_doc.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_doc.py
|
Binary file not shown.
BIN
hemomixer/hemomixer-16.blend1
Normal file
BIN
hemomixer/hemomixer-16.blend1
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_about.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_about.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_config.xml
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_config.xml
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_doc.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_doc.py
|
Binary file not shown.
BIN
pince_schrader/pince_schrader-07.blend1
Normal file
BIN
pince_schrader/pince_schrader-07.blend1
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_about.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_about.py
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_config.xml
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_config.xml
|
@ -1 +1 @@
|
|||||||
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic-player/cine_doc.py
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/kinematic_player/cine_doc.py
|
Binary file not shown.
BIN
serrure_biometrique/serrure_biometrique-37.blend1
Normal file
BIN
serrure_biometrique/serrure_biometrique-37.blend1
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user