Menu

APP_Face

Benedict Jäggi

APP_Face

This App just draws some geometry which looks like a face.

When the upper part is touched, the eyes turn into a clock.
The pupil then moves to the corresponding place.
The left eye shows the hours and has 12 hour indicator lines on it.
The right eye shows the minutes and has 60 minute indicator lines on it.

When the lower part is touched, it switches to APP_MENU by default.

Globals

underlyingApp

The name of the App to switch to when the lower part of the face is touched.

menuToShow

The APP_MENU.cMenu instance which is used for the underlying APP_MENU-App.

App-class

def drawClockLines(self, screen)

Draws the lines for the clock on the eyes when the screen is touched.

screen is the pygame surface to draw on.

def drawPupilLines(self, screen)

Draws the lines on the pupils when the screen is touched.

screen is the pygame surface to draw on.

def setPupilsToTime(self)

Sets the pupil position according to the actual time when the screen is touched.

def drawMouth(self, screen, which)

Draws the mouth geometry on the lower part of the display.
It has several mouths to draw, determined by which.

screen is the pygame surface to draw on.
which is the name of the mouth to draw.
Values are: smile, smile2, o, neutral

def setRandomPupilPosition(self)

Sets the position of the pupils to a random angle.
Also selects randomly a new mouth to draw.

def onMouseUp(self)

Switches to the underlyingApp when the lower part of the display is touched.

def onMouseDown(self)

Shows the clock.

def onSwitchToApp(self)

Sets the APP_MENU.CURRENT_MENU to menuToShow

def update(self, screen, deltatime)

Calls all the drawing functions and also draws the pupils.


Related

Wiki: Home

MongoDB Logo MongoDB