Last active
December 12, 2015 08:08
-
-
Save acbart/4741749 to your computer and use it in GitHub Desktop.
Example Syntax for different abilities in our Sprite CSS language - should be parsable with YAML
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
# Comment | |
# Should these be broken up by Scene? By Sprite? | |
# Do we use "eval" to parse values? | |
# Style collection of widgets | |
.style: | |
property: value | |
# Variables | |
variable: value | |
# Style individual Widgets | |
@id: | |
property: value | |
# Mixins | |
.style1: | |
.style2 | |
# Nested Rules | |
.style1: | |
property: value | |
.style2: | |
property: value | |
# Datatypes | |
variable: "string" | |
variable: 1.0 | |
variable: 5 | |
variable: True | |
variable: ("tuple","thing") | |
variable: ["list","of",3] | |
variable: {"Black" : "Magic", "Blackest": 3} | |
variable: ([1,2,3], ["a","b","c"]) | |
# Functions? | |
variable: 128 + 64 | |
# Constants? | |
area: pi * 2 | |
color: red | |
# Sprite Properties | |
.root: | |
position: (0, 0) | |
pos: (100, -50) | |
x: 5 | |
y: 10 | |
layer: 'top' | |
image: %(resources)s/my_image.png | |
anchor: 'left' | |
scale: 1.5 | |
scale_x: 1.25 | |
scale_y: .5 | |
width: 300 | |
height: 200 | |
size: (300, 400) | |
angle: 90 | |
flip_x: True | |
flip_y: False | |
visible: True | |
# Example font: | |
.header_text: | |
file: %(resources)s/my_image.png | |
size: 22 | |
# Following are optional | |
italic: False | |
bold: False | |
# Built-in widget manipulation: | |
$text_input_widget: | |
.header_text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment