mirror of
https://forge.apps.education.fr/blender-edutech/ropy.git
synced 2024-01-27 08:23:20 +01:00
Invisibilisation des boutons < et > en fonction de la taille de l'écran
This commit is contained in:
parent
2716fb34dd
commit
944b23fb4e
BIN
ropy-31.blend
BIN
ropy-31.blend
Binary file not shown.
28
rp.py
28
rp.py
@ -1392,6 +1392,20 @@ def about_screen_up(cont):
|
||||
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)
|
||||
@ -1411,6 +1425,20 @@ def about_screen_down(cont):
|
||||
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)
|
||||
|
14
rp_about.py
14
rp_about.py
@ -46,6 +46,20 @@ def open():
|
||||
scene.objects['About']['timer'] = 0
|
||||
scene.objects['About']['anim'] = 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()
|
||||
|
||||
##
|
||||
# Animation de l'ouverture
|
||||
##
|
||||
|
Loading…
Reference in New Issue
Block a user