• Stars
    star
    132
  • Rank 272,583 (Top 6 %)
  • Language
    JavaScript
  • License
    Other
  • Created almost 13 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Path menu interface for Appcelerator Titanium

NO LONGER MAINTAINED

pathmenu.js by @tonylukasavage

Add the super-hyped Path menu interface to your Appcelerator Titanium apps. Check out path.com for the inspiration.

Highlights

  • Forging Titanium Episode video - coming soon...
  • Supported on iOS and Android
  • Tested against Titanium Mobile 1.8.1
  • Written almost entirely in Javascript, but leverages the underlying native platforms for great performance

Usage

Basic usage can be found in this repository's app.js file

iconClick Event

When you create a menu with require('path').createMenu(), you have one new event to work with. iconClick will let you know when ever you click on a menu icon. The event object in the iconClick event has the following properties.

  • source - The view that generated the event. In this case, it will be the menu icon that you clicked.
  • index - The index of the icon you clicked on. This can be used to determine which icon you clicked.
  • id - The id of the icon you clicked on. This is a more direct way to identify the icon you clicked, but requires that you set each icons id property when defining the iconList property of the menu.
var menu = require('path').createMenu();
menu.addEventListener('iconClick', function(e) {
    Ti.API.info(e.source);
	Ti.API.info(e.index);
	Ti.API.info(e.id);
});

Menu configuration

The pathmenu.js module's createMenu() call can take a number of parameters to customize its appearance and behavior. All parameters are optional, though you'll likely want to define the iconList property to customize your menu.

  • bounceDistance - Determines the distance of the "bounce" effect when the menu opens. So if the radius of your menu is 100, and your bounceDistance is the default 25, the icons will actually travel 125 pixels/points along their vector before "bouncing" back to 100. (default: 25)
  • buttonImage - The image file or URL to be used to display the main menu button. (default: 'images/add.png')
  • buttonSize - The height and width in pixels/points of the main menu button. (default: 35)
  • fadeDuration - The amount of time, in milliseconds, that it takes for a menu icon to fade and scale out after you click it. (default: 500)
  • iconList - see details below
  • iconRotation - The number of degrees the icons will rotate when the menu is opened/closed
  • iconSize - The height and width in pixels/points of the menu icon buttons (default: 35)
  • menuDuration - The duration, in milliseconds, of the animation necessary to position all menu icons when you either open or close the main menu button via click. NOTE: An additional (menuDuration / 3.5) milliseconds is added to the animation duration to account for the time of the "bounce" effect. (default: 500)
  • radius - The path menu displays menu icons along a 90 degree arc (1st quadrant). The radius determines the radius of the arc with respect to the position of the main menu button. (default: Ti.Platform.displayCaps.platformWidth/2 - iconSize/2)
  • stagger - The amount of time, in milliseconds, to delay animations of each menu icon when it is opened/closed. This gives the menu that staggered, cascading behavior. (default: 25)

iconList detailsΒ 

An array of icons that represent the icons that will appear when you click the menu button. Each icon in iconList has the following properties.

  • image - The actual image file or URL used to display the icon
  • id - (optional) Identifies the icon, used in click events

A sample iconList might look something like this

    var menu = require('path').createMenu({
        iconList: [
          	{ image: 'images/sm/facebook.png', id: 'facebook' },
        	{ image: 'images/sm/pridat.png', id: 'pridat' },
        	{ image: 'images/sm/twitter.png', id: 'twitter' },
        	{ image: 'images/sm/vimeo.png', id: 'vimeo' },
        	{ image: 'images/sm/youtube.png', id: 'youtube' }
        ]
    });

iOS Needs a little help with rotations

The included path.animator module (github project found here) allows iOS views to have a rotation value greater than 180 degrees. This is a limitation of native iOS transform matrices, not Titanium. A more robust, and platform-specific, animation method is required for these rotations. path.animator is an iOS module that resolves that problem. Please check out the path.animator module project page for all the details.

Problems?

Log them in the Issues section of this project. The more detailed the issue, the better the chance it has of getting to the top of my todo list. Bonus points for reproducible test cases.

More Repositories

1

jsstl

Pure Javascript code for parsing and rendering STL (ascii and binary) files
HTML
160
star
2

triple

REPL for Titanium
JavaScript
96
star
3

ti-mocha

Simple and reliable support for mocha testing with Appcelerator's Titanium SDK
JavaScript
64
star
4

path.animator

Appcelerator Titanium iOS module that uses CABasicAnimations to add full rotations to views
Python
48
star
5

Gonzo

A lightweight editor made specifically for markdown.
ActionScript
47
star
6

com.savagelook.android

Android helper classes and methods
Java
36
star
7

ti-commonjs

node.js-style commonjs implementation for Titanium 3.X
JavaScript
35
star
8

tiapp.xml

Titanium tiapp.xml parsing and manipulation API
JavaScript
27
star
9

grunt-titanium

grunt plugin for titanium CLI
JavaScript
21
star
10

ti-fs

Titanium implementation of node.js's fs module
JavaScript
14
star
11

ti-console

node.js-style console for Titanium
JavaScript
12
star
12

ti-stl-viewer

Render and interact with 3D STL models in your Titanium Alloy apps
JavaScript
10
star
13

cv2r

Castlevania II: Simon's Quest Randomizer
Assembly
9
star
14

ticonf-us-alloy-preso

Presentation of advanced Allot topics for TiConf US on June 28th, 2013
JavaScript
8
star
15

physicalSizeCategory

Titanium native module for getting the physical size category, based on density independent pixels, of an Android device
Python
7
star
16

vm-titanium

node.js vm implementation for Titanium
JavaScript
7
star
17

ti-2048

Titanium Alloy version of Gabriele Cirulli's "2048" game
JavaScript
6
star
18

titanium-os

node.js os module for Titanium
JavaScript
5
star
19

grunt-kahvesi

grunt plugin for generating istanbul + mocha coverage reports
JavaScript
5
star
20

Automata

A highly impractical implementation of Conway's Game of Life using only Appcelerator Titanium Views
JavaScript
5
star
21

bolts

An opinionated bootstrap for my node.js projects
JavaScript
3
star
22

Repper-Flex

An Air for Android app built in Flash Builder "Burrito" with Flex "Hero" for calculating your rep maxes on lifts
3
star
23

game-of-life-processing

Game of Life with Processing
Processing
3
star
24

Repper-iPhone

A native iPhone fitness app for calculating your rep maxes on lifts
Objective-C
2
star
25

grunt-alloy

grunt plugin for Appcelerator's Alloy framework for Titanium
JavaScript
2
star
26

Repper-Android

A native Android fitness app for calculating your rep maxes on lifts
Java
2
star
27

Repper-playbook

A Blackberry Playbok app built in Flash Builder "Burrito" with Flex "Hero" and the Blackberry Tablet Air SDK for calculating your rep maxes on lifts
2
star
28

ld

Node.js package for computing the Levenshtein difference between 2 strings
JavaScript
1
star
29

async-in-js

Code for Pittsburgh Javascript meetup on 2016-02-23
JavaScript
1
star
30

DWR-Tracker

Dragon Warrior Randomizer Auto Tracker
C#
1
star
31

game-of-life-xcode

Conway's Game of Life in c++ with SDL
C++
1
star
32

VR-Learning

Unity + Android + Oculus learning
1
star
33

NES-hacking

A collection of NES game glitches, memory mappings, patches, docs, etc...
LSL
1
star
34

titanium-init

Template for writing npm distributable Titanium code
1
star
35

CALM

"Champ And Little Man", my first video game experiment with GameMaker Studio 2
Yacc
1
star
36

path-complete

Node.js package for tab path completion on stdin
JavaScript
1
star