boxespy/boxes/generators/flextest.py

47 lines
1.3 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
2014-03-16 18:26:12 +01:00
# Copyright (C) 2013-2014 Florian Festi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2013-07-01 20:23:56 +02:00
from boxes import *
2016-08-17 15:07:41 +02:00
2013-07-01 20:23:56 +02:00
class FlexTest(Boxes):
2016-03-15 21:03:05 +01:00
"Piece for testing different flex settings"
2016-08-17 15:07:41 +02:00
ui_group = "Part"
def __init__(self):
Boxes.__init__(self)
self.addSettingsArgs(edges.FlexSettings)
self.buildArgParser("x", "y")
2013-07-01 20:23:56 +02:00
def render(self):
x, y = self.x, self.y
2013-07-01 20:23:56 +02:00
self.moveTo(5, 5)
self.edge(10)
2016-05-20 21:33:22 +02:00
self.edges["X"](x, y)
2013-07-01 20:23:56 +02:00
self.edge(10)
self.corner(90)
self.edge(y)
self.corner(90)
2016-08-17 15:07:41 +02:00
self.edge(x + 20)
2013-07-01 20:23:56 +02:00
self.corner(90)
self.edge(y)
self.corner(90)
2016-08-17 15:07:41 +02:00