display.menu_view documentation - wladekpal/The-Lazy-Snek GitHub Wiki

class PickView(ApplicationView)

Menu-like view composed of title and tiles with options to pick.

PickView(screen, title, tiles)

  • screen - screen on which view will be displayed
  • title - string representing title displayed on screen
  • tiles - Tile class objects list of all tiles that should be provided to pick from

refresh()

If screen size changed after last refresh, refreshes visual content displayed on screen. Because PickView content should be static, there's no need to refresh content on every single application frame.

force_refresh()

Updates visual content displayed on screen even if screen size hasn't changed.

class MenuView

Main menu view.

MenuView(screen)

MenuView will be displayed on screen.

class Tile

Abstract class representing clickable tile displayed in PickView.

Tile(text)

text is a string displayed on tile.

action()

Abstract method. Implemented should handle view behaviour after clicking tile.

self_draw(frame, pos, dimension)

Draws itself in frame with top-left corner situated at pos, where dimension is (width, height) tuple of tile dimensions.

handle_click(pos)

If mouseclick on position pos overlaps with tile area, returns tile's action method result. Otherwise returns None.

Class QuitTile

Tile which ends application run when clicked.

Class LevelTile

Tile which displays proper LevelView when clicked.

Class PickLevelViewTile

Tile which displays view with all levels available to choose when clicked.

Class MenuTile

Tile which displays option in menu which swaps current view to another PickView.

class PickLevelView(PickView)

PickView that displays all base levels available in game.