def _create_Lines(self): self.Lines = [] for i in range(self.lines): if self.using == "x": w = float(self.w) / (self.lines - 1) line = RectangleShape((0, self.h)) x = self.x + (w * (i)) line.position = x, self.y if self.using == "y": h = float(self.h) / (self.lines - 1) line = RectangleShape((self.w, 0)) y = self.y + (h * (i)) line.position = self.x, y line.outline_thickness = 1 line.outline_color = Color.BLACK #color c = line.outline_color c.a = self.alpha line.outline_color = c self.Lines.append(line)
def _create_Lines(self): self._columns = [] for x in range(self.tile_w + 1): r = RectangleShape((1, self.h)) r.fill_color = self.color r.position = self.x + (TILE * x), self.y self._columns.append(r) self._rows = [] for y in range(self.tile_h + 1): r = RectangleShape((self.w, 1)) r.fill_color = self.color r.position = self.x, self.y + (TILE * y) self._rows.append(r)
def _create_highlight(self): #init, controls #Find the position of the current box. char = self().character x, y = 0, 0 if char in Text_Ref.characters.upper(): x = Text_Ref.characters.upper().index(char) y = 0 if char in Text_Ref.characters: x = Text_Ref.characters.index(char) y = 1 if char in Text_Ref.grammar: x = Text_Ref.grammar.index(char) y = 2 if char in Text_Ref.numbers: x = Text_Ref.numbers.index(char) y = 3 #Highlight it w, h = 8, 12 highlight = RectangleShape((w, h)) highlight.position = w * x, h * y highlight.fill_color = Color(100, 100, 100, 100) self.highlight = highlight
def render(self): #draw box = RectangleShape(self.size) box.position = self.position box.outline_thickness = 1 box.outline_color = Color(255, 0, 0, 100) box.fill_color = Color(0, 0, 0, 10) self.box = box
def box(self): #draw size = self.w, self.h + self.rise b = RectangleShape(size) b.position = self.x, self.y - self.rise_offset b.outline_thickness = 1 b.outline_color = self.box_outline b.fill_color = self.box_fill return b
def _create_baseLine(self): if self.using == "x": self.baseLine = RectangleShape((self.w, 0)) self.baseLine.position = self.x, self.center[1] if self.using == "y": self.baseLine = RectangleShape((0, self.h)) self.baseLine.position = self.center[0], self.y self.baseLine.outline_thickness = 1 self.baseLine.outline_color = Color(0, 0, 0) #color b = self.baseLine c = b.outline_color c.a = self.alpha b.outline_color = c
def dot(x, y, size=(1, 1), outline_color=Color.RED, outline_thickness=1): d = RectangleShape() d.size = size d.outline_color = outline_color d.outline_thickness = outline_thickness d.x = x d.y = y return d
def _create_box_shading(self): #_create_box w = self.w x, y = self.x, self.y2 - 2 # Box_shading = RectangleShape((w, 2)) Box_shading.fill_color = Color(150, 150, 150) Box_shading.position = x, y # self.Box_shading = Box_shading
def _create_Lines(self): #init self._columns = [] for x in range(self.tile_w + 1): w = 1 if x == 0 or x == self.tile_w: w = 5 r = RectangleShape((w, self.h)) r.fill_color = self.color r.position = self.x + (TILE * x) - (w / 2), self.y self._columns.append(r) self._rows = [] for y in range(self.tile_h + 1): h = 1 if y == 0 or y == self.tile_h: h = 5 r = RectangleShape((self.w, h)) r.fill_color = self.color r.position = self.x, self.y + (TILE * y) - (h / 2) self._rows.append(r)
def _create_box(self): #draw size = self.size position = self.position # Box = RectangleShape(size) Box.position = position Box.fill_color = Color(255, 255, 255) Box.outline_color = Color(0, 0, 0) Box.outline_thickness = 1 # self.Box = Box # self._create_box_shading()
def line(size=(1, 1), outline_color=Color.BLACK, x=0, y=0, rotate=0, outline_thickness=1): l = RectangleShape() l.size = size l.outline_color = outline_color l.outline_thickness = outline_thickness l.x = x l.y = y if rotate != 0: l.rotate(rotate) return l
def shadow(self): #draw w, h = self.size b = RectangleShape((w, self.rise)) b.position = self.x, self.y2 b.fill_color = Color(0, 0, 0, 255) return b
def _init_Box(self): self._Box = RectangleShape(self.size) self._Flicker_Clock = Clock() self._Box.fill_color = Color.BLACK
def _create_drawables(self): #init f = Font("speech") self.Text = Text(f) self.Box = RectangleShape((0, 0)) self.Box_shading = RectangleShape((0, 0))