HandleSheet

author:
lamb-mei (羊小咩)
description:
Use one finger touching for moving, rotating and scaling on Starling
lastupdate:
2013-11-20
compatible:
v0.9.1
depend:
Starling, Starling-Extension-Graphics
tag:
scaling, scale, move, moving, rotating, rotate
homepage:
https://github.com/lamb-mei/HandleSheet
download:
https://github.com/lamb-mei/HandleSheet/archive/master.zip

Overview

Use one finger touching to moving 、 rotating and scaling on Starling

Baseed on Starling 實現單手簡單操作物件位移 、旋轉和縮放

Demo (http://proj.lamb-mei.com/handlesheet/)

Feature

What feature in HandleSheet:

  • one finger touch control button to rotating and scaling
  • two finger touching to rotating and scaling
  • finger touch moving
  • custom control button display
  • scale limit
  • auto bring to front
  • outline border thickness
  • outline border color
  • init by config

Depends

Usage

Basic

var _contents:DisplayObject = new Image(_texture)
var hs:HandleSheet = new HandleSheet(_contents)

Set Control Button By Texture

var hs:HandleSheet = new HandleSheet(_contents)
hs.setCtrlButtonInitByTexture(upTexture, downTexture)
Set Control Button By Factory
 
function imgFactory():Image{
    var img:Image = new Image(_texture)
    return img
}
var hs:HandleSheet = new HandleSheet(_contents)
hs.setCtrlButtonInitByFactory(imgFactory)

Scale limit

var hs:HandleSheet = new HandleSheet(_contents)
hs.minSize = 0.5
hs.maxSize = 2

Custom outline border

var hs:HandleSheet = new HandleSheet(_contents)
hs.thickness = 5
hs.lineColor = 0xF7BD19

Init by Config

var _conf:HandleSheetConfig = new HandleSheetConfig()
_conf.setCtrlButtonInitByTexture(_upTexture, _downTexture)
_conf.dispatchEventBubbles = true
_conf.minSize = 0.5
_conf.lineColor = 0xFF0000
//set config
var hs:HandleSheet = new HandleSheet(_contents , _conf)

Changelog

  • /2013/11/19 : change package into starling.extension
  extensions/handlesheet.txt · Last modified: 2015/03/11 15:06 by 127.0.0.1
 
Powered by DokuWiki