Created
March 23, 2013 21:30
-
-
Save rdeaton/5229433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegisterForm(spyral.Form): | |
name = spyral.TextInputWidget(self, 50, "Name") | |
password = spyral.TextInputWidget(self, 50, "Pass") | |
user_type = spyral.RadioGroup(self, map(partial(spyral.RadioButtonWidget, self), ["Admin", "User", "Guest"])) | |
remember_me = spyral.CheckboxWidget(self) | |
okay = spyral.ButtonWidget(self, "Okay") | |
cancel = spyral.ButtonWidget(self, "Cancel") | |
form = RegisterForm(scene) | |
# Three options | |
# One: Direct to widgets | |
print form.name | |
# <spyral.TextInputWidget ...> | |
form.name.pos = (20, 20) | |
# They're all sprites and they can manipulate them directly | |
# To get values, you do | |
print form.values.name | |
# Two: Straight to values | |
print form.name | |
# Cory | |
print form.password | |
# CorgisAreCool | |
# To get the sprites | |
print form.widgets.name | |
# <spyral.TextInputWidget ...> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment