Пример #1
0
    def __init__(self):
        super().__init__(name="sort")

        self\
            .addSurface(
                Surface(
                    name="back",
                    type_="button",
                    frame=Frame(x=71, y=41, w=112, h=61),
                    actions=[Runclass(self.switchScreen, "back")]
                )
                .addData("image", Images(None, Frame(x=71, y=41, w=112, h=61)))
            )\
            .addSurface(
                Surface(
                    name="info",
                    type_="button",
                    frame=Frame(x=841, y=41, w=112, h=61),
                    actions=[]
                )
                .addData("image", Images(None, Frame(x=841, y=41, w=112, h=61)))
            )\
            .addSurface(
                Surface(
                    name="stats",
                    type_="container",
                    frame=Frame(x=223, y=606, w=752, h=133),
                    selectable=False,
                    actions=[]
                )
                .addData("image", Images(None, Frame(x=223, y=606, w=752, h=133)))
                .addData("speed", Text(
                    frame=Frame(x=349, y=630, w=254, h=40),
                    text="0", suffix=" swaps per sec",
                    format_=TextFormat(fontSize=28, pos="center", warpText=48)
                ))
                .addData("moves", Text(
                    frame=Frame(x=436, y=677, w=167, h=40),
                    text="0",
                    format_=TextFormat(fontSize=28, pos="center", warpText=48)
                ))
                .addData("time", Text(
                    frame=Frame(x=768, y=630, w=177, h=40),
                    text="0.00", suffix=" sec",
                    format_=TextFormat(fontSize=28, pos="center", warpText=48)
                ))
                .addData("length", Text(
                    frame=Frame(x=759, y=677, w=186, h=40),
                    text="0",
                    format_=TextFormat(fontSize=28, pos="center", warpText=48)
                ))
            )\
            .addSurface(
                Surface(
                    name="sortbox",
                    type_="container",
                    frame=Frame(x=52, y=145, w=922, h=430),
                    selectable=False,
                    actions=[]
                )
                .addData("image", Images(None, Frame(x=52, y=145, w=922, h=430)))
                .addChild(
                    Surface(
                        name="rerun",
                        type_="button",
                        frame=Frame(x=906, y=521, w=68, h=55),
                        selectable=False,
                        actions=[]
                    )
                    .addData("image", Images(None, Frame(x=906, y=521, w=68, h=55)))
                )
            )
Пример #2
0
 },
 'confirm': {
     'frame': Frame(x=495, y=256, w=811, h=573),
     'alpha': True,
     'message': {
         'type': 'text',
         'frame': Frame(x=57, y=33, w=696, h=465),
         'imageData': {
             'frame': Frame(x=57, y=33, w=696, h=465)
         },
         'clickSound': None,
         'data': {
             'title':
             Text(frame=Frame(x=57, y=48, w=697, h=95),
                  text='Title Here',
                  format=TextFormat(fontSize=88,
                                    align='center',
                                    pos='center',
                                    colour=PgEss.colour.black)),
             'content':
             Text(frame=Frame(x=57, y=156, w=697, h=183),
                  text='Content of message here.',
                  format=TextFormat(fontSize=68,
                                    align='center',
                                    pos='center',
                                    warpText=24,
                                    lineSpacing=0.8,
                                    colour=PgEss.colour.black)),
         },
     },
     'no': {
         'type': 'button',
Пример #3
0
    def __init__(self):
        super().__init__(name="home")

        self\
        .addSurface(
            Surface(
                name="type",
                type_="button",
                frame=Frame(x=246, y=149, w=729, h=70),
                actions=[]
            )
            .addData("image", Images(None, Frame(x=246, y=149, w=729, h=70)))
            .addData("text", Text(
                frame=Frame(x=271, y=159, w=628, h=53),
                text="Insertion sort",
                format_=TextFormat(fontSize=38, pos="center")
            ))
        )\
        .addSurface(
            Surface(
                name="info",
                type_="button",
                frame=Frame(x=225, y=242, w=751, h=211),
                actions=[]
            )
            .addData("image", Images(None, Frame(x=225, y=242, w=751, h=211)))
            .addData("text", Text(
                frame=Frame(x=252, y=260, w=695, h=168),
                text="Bubble sort, is one of the most simplest sorting algorithm that repeatedly steps through the list, compares adjacent pairs and swaps them if they are in the wrong order.",
                format_=TextFormat(fontSize=31, pos="center", warpText=48)
            ))
        )\
        .addSurface(
            Surface(
                name="speed",
                type_="button",
                frame=Frame(x=271, y=480, w=704, h=70),
                actions=[]
            )
            .addData("image", Images(None, Frame(x=271, y=480, w=704, h=70)))
            .addData("text", Text(
                frame=Frame(x=296, y=490, w=654, h=53),
                text="100.0", suffix=" swaps per sec",
                format_=TextFormat(fontSize=38, pos="center")
            ))
        )\
        .addSurface(
            Surface(
                name="length",
                type_="button",
                frame=Frame(x=403, y=575, w=572, h=70),
                actions=[]
            )
            .addData("image", Images(None, Frame(x=403, y=575, w=572, h=70)))
            .addData("text", Text(
                frame=Frame(x=428, y=585, w=522, h=53),
                text="10", suffix=" bars",
                format_=TextFormat(fontSize=38, pos="center")
            ))
        )\
        .addSurface(
            Surface(
                name="run",
                type_="button",
                frame=Frame(x=781, y=671, w=194, h=70),
                actions=[Runclass(self.switchScreen, "load", "sort")]
            )
            .addData("image", Images(None, Frame(x=781, y=671, w=194, h=70)))
        )
Пример #4
0
     },
     'action': Switchscreen(type='back')
 },
 'page_text': {
     'type': 'text',
     'frame': Frame(x=769, y=974, w=262, h=75),
     'imageData': {
         'frame': Frame(x=769, y=974, w=262, h=106)
     },
     'selectable': False,
     'data': {
         'pages':
         Text(frame=Frame(x=769, y=974, w=262, h=75),
              prefix='1',
              text=' / ',
              suffix='10',
              format=TextFormat(fontSize=68,
                                align='center',
                                pos='center',
                                colour=PgEss.colour.white)),
     }
 },
 'page_back': {
     'type':
     'button',
     'frame':
     Frame(x=729, y=984, w=57, h=40),
     'imageData': {
         'frame': Frame(x=729, y=984, w=96, h=40)
     },
     'action':
     Runclass(run=PlayerRank.updateList, parameters={'page': -1})
Пример #5
0
 },
 'leaderboard': {
     'type': 'object',
     'frame': Frame(x=462, y=443, w=876, h=111),
     'imageData': {
         'frame': Frame(x=462, y=443, w=876, h=111)
     },
     'action': Runclass(run=end_game.textfield_selected),
     'data': {
         'rankid':
         '',
         'postion':
         Text(editable=False,
              frame=Frame(x=465, y=443, w=105,
                          h=111),
              text='1',
              format=TextFormat(fontSize=68,
                                align='center',
                                pos='center',
                                colour=PgEss.colour.white)),
         'nickname':
         Text(
             frame=Frame(x=573, y=443, w=497,
                         h=111),
             text='Demo',
             format=TextFormat(fontSize=68,
                               align='left',
                               pos='center',
                               colour=PgEss.colour.white),
             validation=TextValidate(
                 regex='[\w\s]{1,16}',
                 invalidPrompt=
Пример #6
0
 'options': {
     'frame': Frame(x=0, y=0, w=1800, h=1080),
     'background': {
         'type': 'object',
         'frame': Frame(x=0, y=0, w=1800, h=1080),
         'clickSound': None
     },
     'nickname': {
         'type': 'textfield',
         'frame': Frame(x=747, y=341, w=925, h=140),
         'imageData': {'frame': Frame(x=747, y=341, w=925, h=140)},
         'action': Runclass(run=new_game.textfield_selected),
         'data': {
             'text': Text (
                 frame = Frame(x=747, y=341, w=925, h=140),
                 text = 'Benedict',
                 format = TextFormat(fontSize=116, align='center', pos='center', colour=PgEss.colour.white),
                 validation = TextValidate(regex='[\w\s]{1,16}', invalidPrompt='Player nickname should be between 1 and 16 character\'s long.')
             ),
         },
     },
     'difficulty': {
         'type': 'text',
         'frame': Frame(x=1008, y=636, w=405, h=140),
         'imageData': {'frame': Frame(x=1008, y=636, w=405, h=140)},
         'selectable': False,
         'data': {
             'index': 0,
             'mode': Text (
                 frame = Frame(x=1008, y=636, w=405, h=140),
                 text = 'Easy',
                 format = TextFormat(fontSize=116, align='center', pos='center', colour=PgEss.colour.white)
Пример #7
0
 'alpha': True,
 'back': {
     'type': 'button',
     'frame': Frame(x=141, y=58, w=132, h=103),
     'imageData': {'frame': Frame(x=141, y=58, w=132, h=103)},
     'action': Switchscreen(type='back')
 },
 'page_text': {
     'type': 'text',
     'frame': Frame(x=769, y=974, w=262, h=75),
     'imageData': {'frame': Frame(x=769, y=974, w=262, h=106)},
     'selectable': False,
         'data': {
         'pages': Text (
             frame = Frame(x=769, y=974, w=262, h=75),
             prefix = '1', text = ' / ', suffix = '10',
             format = TextFormat(fontSize=68, align='center', pos='center', colour=PgEss.colour.white)
         ),
     }
 },
 'page_back': {
     'type': 'button',
     'frame': Frame(x=729, y=984, w=57, h=40),
     'imageData': {'frame': Frame(x=729, y=984, w=96, h=40)},
     'action': Runclass(run=PlayerSaves.updateList, parameters={'page': -1})
 },
 'page_next': {
     'type': 'button',
     'frame': Frame(x=1031, y=984, w=57, h=40),
     'imageData': {'frame': Frame(x=1031, y=984, w=96, h=40)},
     'action': Runclass(run=PlayerSaves.updateList, parameters={'page': 1})
Пример #8
0
 'store': {
     'frame': Frame(x=0, y=0, w=1800, h=1080),
     'back': {
         'type': 'button',
         'frame': Frame(x=70, y=50, w=132, h=103),
         'imageData': {'frame': Frame(x=70, y=50, w=132, h=103)},
         'action': Switchscreen(type='back')
     },
     'stats': {
         'type': 'text',
         'frame': Frame(x=1075, y=0, w=725, h=270),
         'imageData': {'frame': Frame(x=1075, y=0, w=725, h=270)},
         'data': {
             'damage': Text (
                 frame = Frame(x=1414, y=81, w=307, h=59),
                 prefix = 'Damage: ',
                 text = '2 - 4',
                 format = TextFormat(fontSize=52, align='left', pos='center', colour=PgEss.colour.red)
             ),
             'defence': Text (
                 frame = Frame(x=1414, y=140, w=307, h=59),
                 prefix = 'Defence: ',
                 text = '1',
                 format = TextFormat(fontSize=52, align='left', pos='center', colour=PgEss.colour.blue)
             ),
             'health': Text (
                 frame = Frame(x=1099, y=81, w=307, h=59),
                 prefix = 'Health: ',
                 text = '20/20',
                 format = TextFormat(fontSize=52, align='left', pos='center', colour=PgEss.colour.green)
             ),
             'elixir': Text (