mirror of
https://github.com/zhigang1992/RubyMotion-PixateFreestyle.git
synced 2026-01-12 17:52:19 +08:00
827989b0bcd73d75838d7e81c040b018579a90a1
RubyMotion-Pixate
Pixate gem for RubyMotion.
Requirements
- RubyMotion 1.0 or greater (see http://www.rubymotion.com).
Setup
- Download the Pixate Framework package from http://www.pixate.com/ and copy the
PXEngine.frameworkfolder intovendordirectory. Create thevendordirectory if it does not exist. You should have something like this.
$ ls vendor/PXEngine.framework
/Headers/ PXEngine Resources/ Versions/
- Edit the
Rakefileof your RubyMotion project and add the following require lines.
require 'rubygems'
require 'motion-pixate'
- Still in the
Rakefile, set up theuser,keyandframeworkvariables in your application configuration block.
Motion::Project::App.setup do |app|
# ...
app.pixate.user = 'USER ID'
app.pixate.key = 'KEY CODE'
app.pixate.framework = 'vendor/PXEngine.framework'
end
- Create the
default.cssinresourcesdirectory.
Usage
motion-pixate provides "style" method in REPL. You could change the stylesheet at the moment in REPL.
(main)> style "button { color : blue; }"
(main)> style "button { background-color: red; corner-radius: 20pt; }"
motion-pixate supports Sass to generate the stylesheet. Create the sass directory and default.scss with the rake pixate:init command. Then, rake pixate:sass command generates the stylesheet from default.scss.
You could specify the Sass output style through style environment variable. For example,
$ rake pixate:sass style=compressed
You could use nested, expanded, compact and compressed as output style.
Description
Languages
Ruby
100%