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.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 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 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 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 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 draw(self, view): if self.dragRect == None: return sprite = RectangleShape(self.dragRect.size) sprite.position = self.dragRect.position sprite.fill_color = Color.TRANSPARENT sprite.outline_color = Color.RED sprite.outline_thickness = 0.1 view.drawList[SelectionController.DRAG_RECT_LAYER].append(sprite)
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 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 _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 draw(self, view): if Options.NGUI_FOCUS_DEBUG: if self._mouseWithin == True: r = RectangleShape() r.outline_color = Color.RED r.outline_thickness = 3 r.fill_color = Color.TRANSPARENT r.position = (self._ax, self._ay) r.size = (self._w, self._h) view.drawSprite(r) if self._mouseFocus: view.drawLine(Color.RED, (self._ax, self._ay), (self._ax + self._w, self._ay + self._h)) view.drawLine(Color.RED, (self._ax + self._w, self._ay), (self._ax, self._ay + self._h))
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 drawButton(self, view, bacgroundColour, outlineColour, style): r = RectangleShape() r.outline_color = outlineColour r.outline_thickness = 1 r.fill_color = bacgroundColour r.position = (self._ax, self._ay) r.size = (self._w, self._h) view.drawSprite(r) textSprite = TextManager.renderText(self.text, style) rect = textSprite.local_bounds # Needs rect.left and stuff because text local bounds are apparently non-0. # Something to do with text alignment, perhaps? :) textSprite.position = (self._ax + self._w // 2 - (rect.width // 2) - rect.left, self._ay + self._h // 2 - (rect.height // 2) - rect.top) view.drawSprite(textSprite)