Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

motion-now

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion-now

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

now

motion-now is a DSL for working with UIViews in your rubymotion application. Now borrows all of it's good ideas from jQuery.

Installation

to install now, run:

gem install motion-now

add the following line to your rubymotion Rakefile

require 'motion-now'

Examples

Creating views

Creating a button that says 'Hi!'

button = Now.button "Say Hi!" do |button|
  button.width 100
  button.height 50
end.click do
  Now.alert "Hi!"
end

self.view.now.add button	

Moving Views Around

circle = Now.view do |view|
	view.size "10x10"
	view.border_radius 10
	view.background_color "#f4f4f4"
end

# To center a view in its parent view
circle.center

# To align in the top-right corner of parent view
# Same as circle.top(0).right(0)
circle.top.right 	

Sizing Views

square = Now.view

# make the height 10px
square.height 10

# every square is the same size on all sides
square.width 10

# there's an easier way
square.size "10x10"
# or ..
square.size [10, 10]

Properties

ball = Now.image "ball.png"

# to hide ball:
ball.hide

# let's bring it back
ball.show

# let's ghostify it
ball.alpha(10)
.shadow(1, 1, 10, "blue")
.add_animation(:giggle)


FAQs

Package last updated on 23 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc