Git Product home page Git Product logo

karabiner's Introduction

Karabiner

Karabiner is UI library for as3.

demo

This library provides the basic UI components.

  • Button
  • ImageLoader
  • DraggableObject
  • Scroll and Slider
  • ScrollPage and Indicator

Available in touch and mouse input. These can be implemented with a few code.

The library does not have the view element. It takes the layout MovieClip from SWC, and wraps using the component class. This allows you to customize the view element.

All of the component object inherits from "Karabiner.FrameworkObjectBase", it is initialized by being "addChild ()" to the stage. Is destructor processing by being similarly "removeChild ()".

You can use the Backpack If you want to start the project immediately.

Require

Usage

./src/Main.as and ./gui/GUI.fla.

Button

./src/SampleButton.as

var btn:SampleButton = new SampleButton();
btn.WrapFromSWC(view.getChildByName("sample_button"));

ImageLoader

var image:ImageObject = new ImageObject("http://PATH/TO/IMAGE.png", null, false);
image.SetPostLoadSizing(100, 100);
image.LoadImage();

DraggableObject

var drag:SimpleDraggableObject = new SimpleDraggableObject();
drag.WrapFromSWC(view.getChildByName("sample_simple_draggable"));
var drag:DraggableObject = new DraggableObject(new Rectangle(0, 0, stageWidth, stageHeight));
drag.WrapFromSWC(view.getChildByName("sample_smooth_draggable"));
drag.DragStart();

Scroll and Slider

var container:VirticalScrollContainer =
	new VirticalScrollContainer(view.getChildByName("sample_scroll_mask_1").getRect(view));
container.WrapFromSWC(view.getChildByName("sample_scroll_text_1"));
container.InitDrag();
var slider:SliderObject = new SliderObject(DRAG_DIRECTION.VIRTICAL);
slider.WrapFromSWC(view.getChildByName("sample_slider"));

slider.addEventListener(SliderEvent.CHANGE_SLIDER_VALUE, function(e:Event):void {
	container.SetScroll(slider.SliderValue, slider.height);
});
slider.SetThumbSize(masked_area.height / scroll_text.height);
slider.InitDrag();

ScrollPage and Indicator

var pageList:ScrollPageList = new ScrollPageList(pages, pages[0].width);
view.addChild(pageList);

var pageIngicator:PageIndicator = new PageIndicator(pageList, pages.length, 50, IngicatorBtnView);
view.addChild(pageIngicator);

karabiner's People

Contributors

sharkattack51 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.