def __init__(self,name='',**kw): super(Balrog,self).__init__(name,**kw) self.dark = lighting.claim_light() lighting.light_colour(self.dark,(-0.1,-0.8,-0.8,1.0)) x,y,z = self.pos lighting.light_position(self.dark,(x,y,1.0,1.0)) lighting.light_attenuation(self.dark,0.02) lighting.light_switch(self.dark,True)
def build_parts(self, **kw): # menus = OrthoView("menus",[], _vport=(0,0,1024,768)) # with menus.compile_style(): # glDisable(GL_LIGHTING) sv = SceneView("scene", [], _vport=(0.0, 128, 1.0, 1.0), _ClearColor=(0.3, 0.3, 0.3, 1.0), _perspective_angle=30.0) hroom = Room("Room", self.room + ".txt") outdoors = "outdoors" in hroom.flags ppos = hroom.gates.get(self.start, (0, 0, 0)) sv.append(hroom) self.camera = sv.camera self.player = Player((ppos[0], ppos[1], 0), ppos[2], 1.2, self.camera) with sv.compile_style(): glEnable(GL_LIGHTING) lighting.two_side(True) lighting.local_viewer(True) lighting.light_position(self.light, (hroom.width / 2, hroom.height / 2, 2, 1)) lighting.light_colour(self.light, (1, 1, 0.9, 1)) lighting.light_switch(self.light, True) lighting.light_attenuation(self.light, (0, ) if (outdoors) else (0.01, )) self.append(sv) ov = OrthoView("itembar", [], _vport=(0.0, 0.0, 1.0, 128), _ClearColor=(0.1, 0, 0, 1.0), _left=0, _right=1024, _top=128, _bottom=0) speechport = OrthoView("speech", [], _ClearColor=None, _left=0, _right=1024, _top=768, _bottom=0) with ov.compile_style(): glDisable(GL_LIGHTING) with speechport.compile_style(): glDisable(GL_LIGHTING) self.append(ov) self.append(speechport) tpanel = LabelPanel("text", hroom.name, _text_width=1000, _pos=(512, 48, 0)) ov.append(tpanel)
def build_parts(self,**kw): # menus = OrthoView("menus",[], _vport=(0,0,1024,768)) # with menus.compile_style(): # glDisable(GL_LIGHTING) sv = SceneView("scene",[], _vport=(0.0, 128, 1.0, 1.0), _ClearColor=(0.3, 0.3, 0.3, 1.0), _perspective_angle=30.0) hroom = Room("Room",self.room+".txt") outdoors = "outdoors" in hroom.flags ppos = hroom.gates.get(self.start,(0,0,0)) sv.append(hroom) self.camera = sv.camera self.player = Player((ppos[0],ppos[1],0),ppos[2], 1.2, self.camera) with sv.compile_style(): glEnable(GL_LIGHTING) lighting.two_side(True) lighting.local_viewer(True) lighting.light_position(self.light,(hroom.width/2, hroom.height/2, 2,1)) lighting.light_colour(self.light,(1,1,0.9,1)) lighting.light_switch(self.light,True) lighting.light_attenuation(self.light, (0,) if (outdoors) else (0.01,)) self.append(sv) ov = OrthoView("itembar", [], _vport=(0.0,0.0,1.0,128), _ClearColor=(0.1, 0, 0, 1.0), _left=0, _right=1024, _top=128, _bottom=0) speechport = OrthoView("speech", [], _ClearColor=None, _left=0, _right=1024, _top=768, _bottom=0) with ov.compile_style(): glDisable(GL_LIGHTING) with speechport.compile_style(): glDisable(GL_LIGHTING) self.append(ov) self.append(speechport) tpanel = LabelPanel("text", hroom.name, _text_width=1000, _pos=(512,48,0)) ov.append(tpanel)