Пример #1
0
 def push_tile(self, x, y):
     self.init_tile(x, y)
     new_data = self.tile_storage[x, y]
     if new_data != self.tile_client_cache.get((x, y)):
         self.tile_client_cache[x, y] = new_data
         stream.add_message({
             'type': 'tile',
             'id': '%d,%d' % (x, y),
             'data': new_data
         })
Пример #2
0
    def draw(self, surf, pos):
        surf.draw_rect((255, 255, 255, 0), pos + self.size, blend=graphics.MODE_NONE)
        stream.add_message({'type': 'tile', 'draw_at': pos + self.size})

        self.tick()

        ui.layer_hooks.execute(id='map',
                               surf=None,
                               pos=pos,
                               offset=(0, 0),
                               size=self.size)
Пример #3
0
    def draw(self, surf, pos):
        surf.draw_rect((255, 255, 255, 0),
                       pos + self.size,
                       blend=graphics.MODE_NONE)
        stream.add_message({'type': 'tile', 'draw_at': pos + self.size})

        self.tick()

        ui.layer_hooks.execute(id='map',
                               surf=None,
                               pos=pos,
                               offset=(0, 0),
                               size=self.size)
Пример #4
0
 def send_config(self, m):
     stream.add_message({'type': 'tile_config',
                         'tile_size': self.tile_size})
Пример #5
0
 def push_tile(self, x, y):
     self.init_tile(x, y)
     new_data = self.tile_storage[x, y]
     if new_data != self.tile_client_cache.get((x, y)):
         self.tile_client_cache[x, y] = new_data
         stream.add_message({'type': 'tile', 'id': '%d,%d' % (x, y), 'data': new_data})
Пример #6
0
 def global_set_mapview_center(self, x, y):
     stream.add_message({'type': 'tiles_center_at', 'pos': (x, y)})
Пример #7
0
 def send_config(self, m):
     stream.add_message({
         'type': 'tile_config',
         'tile_size': self.tile_size
     })
Пример #8
0
 def global_set_mapview_center(self, x, y):
     stream.add_message({'type': 'tiles_center_at', 'pos': (x, y)})