From 5dc2ede4623608db76524faff04fa6f3640c8e4c Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 06 Jan 2012 00:20:39 +0000 Subject: add adjusters for number blocks --- (limited to 'TurtleArt/tasprite_factory.py') diff --git a/TurtleArt/tasprite_factory.py b/TurtleArt/tasprite_factory.py index 3164140..d9f2cc0 100755 --- a/TurtleArt/tasprite_factory.py +++ b/TurtleArt/tasprite_factory.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -#Copyright (c) 2009,10 Walter Bender +#Copyright (c) 2009-12 Walter Bender #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -393,6 +393,32 @@ class SVG: self.margins[2] = int(self._stroke_width * self._scale) return self.header() + svg + def triangle_up(self, colors): + ''' A triangle that points up ''' + self.reset_min_max() + self._fill, self._stroke = colors[0], colors[1] + self._width, self._height = 55, 55 + svg = self.new_path(0, 55) + svg += self._rline_to(27.5, -55) + svg += self._rline_to(27.5, 55) + svg += self._close_path() + svg += self.style() + svg += self.footer() + return self.header() + svg + + def triangle_down(self, colors): + ''' A triangle that points down ''' + self.reset_min_max() + self._fill, self._stroke = colors[0], colors[1] + self._width, self._height = 55, 55 + svg = self.new_path(0, 0) + svg += self._rline_to(27.5, 55) + svg += self._rline_to(27.5, -55) + svg += self._close_path() + svg += self.style() + svg += self.footer() + return self.header() + svg + def turtle(self, colors): ''' Turtles are just another block ''' self.reset_min_max() -- cgit v0.9.1