Coder Social home page Coder Social logo

jonnyijapan / cccontrolextension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yannickl/cccontrolextension

0.0 2.0 1.0 9.77 MB

Collection of classes to make the design of controls easier for Cocos2d-for-iPhone

Home Page: http://yannickloriot.com/2013/02/the-control-extension-for-cocos2d/

License: Other

Python 0.05% Objective-C 85.45% C 13.75% C++ 0.64% MATLAB 0.09% Shell 0.01%

cccontrolextension's Introduction

CCControlExtension

CCControlExtension is an open-source library which provides a lot of convenient control objects for Cocos2D v2.x for iPhone and Mac such as buttons, sliders or many more... (see the exhaustive list)

All these controls are subclasses of CCControl, which is inspired by the UIControl API from the UIKit of CocoaTouch. The main goal of CCControl is to simplify the creation of control objects in Cocos2D by providing an interface and a base implementation ala UIKit. I.e that this class manages the target-action pair registration and dispatches them to their targets when events occur. The CCControl extensions also uses the power of blocks to dispatch the events in addition to the target/action pair.

Note: The CCControlExtension's classes are ARC compatibles (e.g for use with Kobold2D)

Note2: the version for Cocos2D v1.1 is available in the master branch

Available Control List

  • Button: Intercepts touch events and sends an action message to a target object when tapped.
  • Colour Picker: It's a very useful control tool to preview and test color values.
  • Picker: Use a spinning-wheel or slot-machine metaphor to show one set of values.
  • Potentiometer: Use a circular representation to show and select a single value from a continuous range of value.
  • Slider: Use a linear representation to show and select a single value from a continuous range of values.
  • Stepper: User interface for incrementing or decrementing a value.
  • Switch: Useful to create and manage On/Off buttons, like for example, in the option menus for volume as example.

How to use it

  • Include the CCControlExtension folder into your project

  • In the needed files include this header:

      #import "CCControlExtension.h"
    

The CCControlExtension.h includes all the already controls. There are various examples to understand how the controls works and to use pre-made visual for each of them.

For more informations you can check my blog and the api documentation.

Getting started with the source

The project already include a version of Cocos2D for its examples, so you just need to download the source like the following instructions:

    git clone [email protected]:YannickL/CCControlExtension.git

    # to get latest stable source from master branch, use this command:
    cd CCControlExtension
    git checkout master-v2

    # to update the sources
    git pull

Build & Runtime Requirements

  • Xcode 4.2 or newer (LLVM 3.0 or newer)
  • iOS 4.0 or newer for iOS games
  • Mac OS X 10.6 or newer for Mac games

License (MIT)

As well as Cocos2D for iPhone, CCControlExtension is licensed under the MIT License:

Copyright (c) 2013 - Yannick Loriot and contributors (see each file to see the different copyright owners)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can download cocos2d-for-iphone here: https://github.com/cocos2d/cocos2d-iphone

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.