def __init__(self, app_name, x, y, w, h): self.children = [] self.x = x self.y = y self.w = w self.h = h self.app = ac.newApp(app_name) ac.setTitle(self.app, app_name) ac.setSize(self.app, self.w, self.h) ac.setIconPosition(self.app, 0, -10000) ac.setTitlePosition(self.app, 0, -10000) ac.drawBorder(self.app, 0) ac.drawBackground(self.app, 0) self.update()
def __init__(self, app_name, app_title, w, h, bg=Color(0, 0, 0, 0.8)): super().__init__(None) self._app_name = app_name self._app_title = app_title self._w = w self._h = h self._bg = bg self._size = (w, h) self.app = ac.newApp(app_name) self.ac_obj = self.app ac.setTitle(self.app, app_title) ac.setSize(self.app, w, h) ac.setIconPosition(self.app, 100000, 0) ac.setTitlePosition(self.app, 100000, 0) ac.drawBorder(self.app, 0) ac.drawBackground(self.app, (bg.a > 0)) ac.setBackgroundColor(self.app, bg.r, bg.g, bg.b) ac.setBackgroundOpacity(self.app, bg.a) self.background_color = bg
def acMain(ac_version): global shadow, label, appWindow appWindow = ac.newApp("SimpleSpeedo") ac.setSize(appWindow, 120, 60) ac.setBackgroundOpacity(appWindow, 0) ac.drawBorder(appWindow, 0) ac.setIconPosition(appWindow, 0, -9000) -ac.setTitlePosition(appWindow, 0, -9000) shadow = ac.addLabel(appWindow, "?") ac.setFontSize(shadow, 44) ac.setPosition(shadow, 61, 1) ac.setFontColor(shadow, 0.2, 0.2, 0.2, 0.2) ac.setFontAlignment(shadow, "center") label = ac.addLabel(appWindow, "?") ac.setFontSize(label, 44) ac.setPosition(label, 60, 0) ac.setFontColor(label, 1, 1, 1, 0.4) ac.setFontAlignment(label, "center") return "SimpleSpeedo"
def title_pos(self, title_pos: tuple): self._title_pos = title_pos if self.has_id and len(title_pos) == 2: ac.setTitlePosition(self.id, title_pos[0], title_pos[1])
def hideDecoration(self): if self._ac_obj is not None: ac.setTitlePosition(self._ac_obj, 0, -10000) ac.setIconPosition(self._ac_obj, 0, -10000) return self
def title_position(self, title_position): self._title_position = title_position if self._ac_obj is not None: ac.setTitlePosition(self._ac_obj, 0, -10000)