add about window and colony model

This commit is contained in:
Philippe Roy 2022-08-16 03:14:28 +02:00
parent 70073cef68
commit cfd5471062
2 changed files with 26 additions and 15 deletions

BIN
ropy-05.blend Normal file

Binary file not shown.

41
rp.py
View File

@ -765,25 +765,28 @@ def mouse_down():
# About
###############################################################################
color_link = (0.799, 0.617, 0.021, 1) # Jaune
color_link_hl = (0.8, 0.8, 0.8, 1) # Blanc
color_link = (0, 1, 0.857,1) # Turquoise
color_link_hl = (0.799, 0.617, 0.021, 1) # Jaune
##
# Ouvrir le about
##
def about_open():
print ("about_open")
scene.objects['Terrain']['manip_mode']=9 # Fenêtre modale
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_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-gpl'].color= color_link
scene.objects['About_link-upbge'].color= color_link
scene.objects['About_link-kay'].color= color_link
scene.objects['About_link-kenney'].color= color_link
scene.objects['About_link-polygonrunway'].color= color_link
scene.objects['About_close'].color= color_link
scene.objects['About'].setVisible(True,True)
scene.objects['About'].worldPosition = [0, 1.53623, -1.8] # old [0, 1.53623, -0.892838]
scene.objects['About']['timer'] = 0
@ -795,7 +798,9 @@ def about_open():
def about_open_anim():
pas=0.5
scene.objects['About'].localPosition.y -= pas
print ("about animation")
# scene.objects['About'].localPosition.y -= pas
scene.objects['About'].localPosition.y -= 1.09*pas
scene.objects['About'].localPosition.z += 0.85*pas
# scene.objects['About'].localPosition.y=scene.objects['About'].localPosition.y-1*pas
# scene.objects['About'].localPosition.z=scene.objects['About'].localPosition.z+0.85*pas
@ -811,16 +816,22 @@ def about_hl(cont):
if cont.sensors['MO'].status == JUST_ACTIVATED:
if scene.objects['Mouse_main']['mouse_graphic']:
mouse_up()
scene.objects['Aboutbanner'].color = color_white
scene.objects['About_close'].color = color_white
scene.objects['About_title'].color = color_white
obj = cont.owner
name=obj.name[:-7]
scene.objects[name].color = color_link_hl
# scene.objects['Aboutbanner'].color = color_white
# scene.objects['About_close'].color = color_white
# scene.objects['About_title'].color = color_white
if cont.sensors['MO'].status == JUST_RELEASED:
if scene.objects['Mouse_main']['mouse_graphic']:
mouse_down()
scene.objects['Aboutbanner'].color = color_endbanner_bluelight
scene.objects['About_close'].color = color_link
scene.objects['About_title'].color = color_black
obj = cont.owner
name=obj.name[:-7]
scene.objects[name].color = color_link
# scene.objects['Aboutbanner'].color = color_endbanner_bluelight
# scene.objects['About_close'].color = color_link
# scene.objects['About_title'].color = color_black
##
# Fermer le about
@ -851,12 +862,12 @@ def about_link(cont):
obj = cont.owner
name=obj.name[:-7]
link={
'About_link-git' : 'https://gitlab.com/phroy/ropy',
'About_link-git' : 'https://gitlab.com/blender-edutech/ropy',
'About_link-gpl' : 'https://www.gnu.org/licenses/gpl-3.0.html',
'About_link-blender': 'https://www.blender.org',
'About_link-upbge' : 'https://www.upbge.org',
'About_link-kay' : 'https://www.kaylousberg.com',
'About_link-kenney' : 'https://www.kenney.nl'}
'About_link-kenney' : 'https://www.kenney.nl',
'About_link-polygonrunway' : 'https://polygonrunway.com/'}
webbrowser.open(link [name])
# FIXME: souris graphique trop compliqué