Exemple #1
0
  def drawBG(self, obs, sun):

    self.BGupdate = datetime.now()

    self.BG.fill((0,0,0)) # clear window

    sunaltd = math.degrees(sun.alt)
#    print "sun alt {}".format(sunaltd)
    if (sunaltd > 0):
        self.bgColor = (32,32,92) # daytime
    elif (sunaltd > -15): # twilight ???
        self.bgColor = (16,16,64)
    else:
        self.bgColor = (0,0,0)

    pygame.draw.circle(self.BG, self.bgColor, (160,120), 120, 0)
    pygame.draw.circle(self.BG, (0,255,255), (160,120), 120, 1)

    txtColor = Cyan
    txtFont = pygame.font.SysFont("Arial", 14, bold=True)
    txt = txtFont.render("N" , 1, txtColor)
    self.BG.blit(txt, (155, 0))
    txt = txtFont.render("S" , 1, txtColor)
    self.BG.blit(txt, (155, 222))
    txt = txtFont.render("E" , 1, txtColor)
    self.BG.blit(txt, (43, 112))
    txt = txtFont.render("W" , 1, txtColor)
    self.BG.blit(txt, (263, 112))

    plotStars(self.BG, obs, sun)
    plotPlanets(self.BG, obs, sun)
Exemple #2
0
  def drawBG(self, obs, sun):

    self.BGupdate = datetime.now()

    self.BG.fill((0,0,0)) # clear window

    sunaltd = math.degrees(sun.alt)
#    print "sun alt {}".format(sunaltd)
    if (sunaltd > 0):
        self.bgColor = (32,32,92) # daytime
    elif (sunaltd > -15): # twilight ???
        self.bgColor = (16,16,64)
    else:
        self.bgColor = (0,0,0)

    pygame.draw.circle(self.BG, self.bgColor, (centerX,centerY), diameter, 0)
    pygame.draw.circle(self.BG, (0,255,255), (centerX,centerY), diameter, 1)

    txtColor = Cyan
    txtFont = pygame.font.SysFont("Arial", 14, bold=True)
    txt = txtFont.render("N" , 1, txtColor)
    rect = txt.get_rect()
    rect.centerx, rect.centery = getxyD(7,0)
    self.BG.blit(txt, rect)
    txt = txtFont.render("S" , 1, txtColor)
    rect = txt.get_rect()
    rect.centerx, rect.centery = getxyD(6,180)
    self.BG.blit(txt, rect)
    txt = txtFont.render("E" , 1, txtColor)
    rect = txt.get_rect()
    rect.centerx, rect.centery = getxyD(6,90)
    self.BG.blit(txt, rect)
    txt = txtFont.render("W" , 1, txtColor)
    rect = txt.get_rect()
    rect.centerx, rect.centery = getxyD(7,270)
    self.BG.blit(txt, rect)

    plotStars(self.BG, obs, sun)
    plotPlanets(self.BG, obs, sun)