def onSelectElement(self, element=None): self.focus_element = element if self.element_icon: self.frame.removeElement(self.element_icon) self.element_icon = None if element: w, h = self.frame.rect.size icon = GraphicIcon(element.frame, element.avatar.faceImage, None) icon.rect = pygame.Rect(w-32,0,32,32) icon.load() element.frame.addElement(icon) self.element_icon = icon
def onSelectElement(self, element=None): self.focus_element = element if self.element_icon: self.frame.removeElement(self.element_icon) self.element_icon = None if element: w, h = self.frame.rect.size icon = GraphicIcon(element.frame, element.avatar.faceImage, None) icon.rect = pygame.Rect(w - 32, 0, 32, 32) icon.load() element.frame.addElement(icon) self.element_icon = icon
def func(menu): import lib.blacksmith as b menu.close() camera = menu.element.camera body = camera.area.getBody(target.avatar) endpoint = camera.surfaceToWorld(menu.anchor) path = camera.area.pathfind(body.bbox.bottomcenter, endpoint) #s = area.MovementSentinal(body, path) #camera.area.add(s) image = Image("path.png") for node in path: y, x = node icon = GraphicIcon(element.frame, image, closer) icon.load() icon.rect = pygame.Rect(x * 16, y * 16, 16, 16) menu.frame.addElement(icon)
def func(menu): import lib.blacksmith as b menu.close() camera = menu.element.camera body = camera.area.getBody(target.avatar) endpoint = camera.surfaceToWorld(menu.anchor) path = camera.area.pathfind(body.bbox.bottomcenter, endpoint) #s = area.MovementSentinal(body, path) #camera.area.add(s) image = Image("path.png") for node in path: y, x = node icon = GraphicIcon(element.frame, image, closer) icon.load() icon.rect = pygame.Rect(x*16, y*16, 16, 16) menu.frame.addElement(icon)