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 })
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)
def send_config(self, m): stream.add_message({'type': 'tile_config', 'tile_size': self.tile_size})
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})
def global_set_mapview_center(self, x, y): stream.add_message({'type': 'tiles_center_at', 'pos': (x, y)})
def send_config(self, m): stream.add_message({ 'type': 'tile_config', 'tile_size': self.tile_size })