#ifndef __CCCONTROLPOTENTIOMETER_H__

#define __CCCONTROLPOTENTIOMETER_H__

#include "CCControl.h"

NS_CC_EXT_BEGIN

/**

* @addtogroup GUI

* @{

* @addtogroup control_extension

* @{

*/

/** @class CCControlPotentiometer Potentiometer control for Cocos2D. */

class CCControlPotentiometer : public CCControl

{

public:

CCControlPotentiometer();

virtual ~CCControlPotentiometer();

/**

* Creates potentiometer with a track filename and a progress filename.

*/

static CCControlPotentiometer* create(const char* backgroundFile, const char* progressFile, const char* thumbFile);

/**

* Initializes a potentiometer with a track sprite and a progress bar.

*

* @param trackSprite CCSprite, that is used as a background.

* @param progressSprite CCProgressTimer, that is used as a progress bar.

*/

bool initWithTrackSprite_ProgressTimer_ThumbSprite(CCSprite* trackSprite, CCProgressTimer* progressTimer, CCSprite* thumbSprite);

void setValue(float value);

float getValue();

void setMinimumValue(float minimumValue);

float getMinimumValue();

void setMaximumValue(float maximumValue);

float getMaximumValue();

void setEnabled(bool enabled);

virtual bool isTouchInside(CCTouch * touch);

virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);

virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);

virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);

protected:

CC_SYNTHESIZE_RETAIN(CCSprite*, m_pThumbSprite, ThumbSprite)

CC_SYNTHESIZE_RETAIN(CCProgressTimer*, m_pProgressTimer, ProgressTimer)

CC_SYNTHESIZE(CCPoint, m_tPreviousLocation, PreviousLocation)

/** Contains the receiver’s current value. */

float           m_fValue;

/** Contains the minimum value of the receiver.

* The default value of this property is 0.0. */

float           m_fMinimumValue;

/** Contains the maximum value of the receiver.

* The default value of this property is 1.0. */

float           m_fMaximumValue;

/** Factorize the event dispath into these methods. */

void potentiometerBegan(CCPoint location);

void potentiometerMoved(CCPoint location);

void potentiometerEnded(CCPoint location);

/** Returns the distance between the point1 and point2. */

float distanceBetweenPointAndPoint(CCPoint point1, CCPoint point2);

/** Returns the angle in degree between line1 and line2. */

float angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(

CCPoint beginLineA,

CCPoint endLineA,

CCPoint beginLineB,

CCPoint endLineB);

};

// end of GUI group

/// @}

/// @}

NS_CC_EXT_END

#endif /* __CCCONTROLPOTENTIOMETER_H__ */


CCControlExtension/CCControlPotentiometer的更多相关文章

  1. GUI之CCControlExtension

    Introduction CCControl is inspired by the UIControl API class from the UIKit library of CocoaTouch. ...

  2. cocos2d-x特效之CCControlPotentiometer

    在test示例下面,有一个关于此功能的代码,实现的效果如下: 通过拉动可旋转的按钮,从而改变所代表的值,这个效果的确是很棒的,但,和我的需求有一些差别,先贴上我实现的效果吧               ...

  3. Cocos2d-x CCControlPotentiometer之圆形音量button及特效

    1. 圆形音量button 事实上作者的本意应该是叫做"电位计button".可是我觉得它和我们的圆形音量button非常像,所以就这么叫它吧~先看效果: 好了,不多解释,本篇到此 ...

  4. CCControlExtension/CCControl

    #ifndef __CCCONTROL_H__ #define __CCCONTROL_H__ #include "CCInvocation.h" #include "C ...

  5. CCControlExtension/CCControlButton

    #ifndef __CCCONTROL_BUTTON_H__ #define __CCCONTROL_BUTTON_H__ #include "CCControl.h" #incl ...

  6. cocos2d-x3.2 使用开关控制按钮 ControlSwitch

    ContolSwitch 控件起到了一个开关的作用类似于现实生活中的开关,直接上代码: .h文件 // // SwitchBtnScene.h // LSWGameIOS // // Created ...

  7. Cocos2D-x培训课程

    1.1 Cocos2D-x 什么是cocos2d-x cocos2d-x在游戏开发中的运用 cocos2d-x的几个重要版本特点 iOS环境下搭建cocos2d开发环境 windows平台搭建coco ...

  8. Cocos2d-x C++调用Android弹出提示框

    转载请注明地址,谢谢.. Cocos2d-x中提供了一个JniHelper类来让我们对Jni进行操作. (PS:弄了一天想自己写代码操作Jni的,但是总是出错,技术差不得不使用Cocos2d-x现成的 ...

  9. 按 Eclipse 开发喜好重新布置 cocos2dx 目录层次

    [tonyfield 2013.08.29 ] 1.  Cocos2dx 库的改动 处于个人的固执,花一天时间重新布置了cocos2dx 2.1.4的目录层次,将android平台无关的代码全数裁剪, ...

随机推荐

  1. Django学习笔记(一)——安装,创建项目,配置

    疯狂的暑假学习之 Django学习笔记(一) 教材  书<The Django Book> 视频:csvt Django视频 1.创建项目 django‐admin.py startpro ...

  2. HDU 2181 DFS

    Problem Description 一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每一个城市刚好一次后回到出发的城市.   Input 前20行的第i行有3 ...

  3. Android中添加自己的模块 【转】

    本文转载自:http://wallage.blog.163.com/blog/static/17389624201021791333695/ 转:http://blog.csdn.net/yili_x ...

  4. DB-MySQL:MySQL 索引

    ylbtech-DB-MySQL:MySQL 索引 1.返回顶部 1. MySQL 索引 MySQL索引的建立对于MySQL的高效运行是很重要的,索引可以大大提高MySQL的检索速度. 打个比方,如果 ...

  5. Binary Indexed Tree 总结

    特点 1. 针对 数组连续子序列累加和 问题(需要进行频繁的 update.sum 操作): 2. 并非是树型结构,只是逻辑上层次分明: 3. 可以通过 填坑法 来理解: 4. 中心思想:每一个整数都 ...

  6. maven 项目加载本地JAR

     将jar安装到本地的maven仓库 1.首先确定本地有maven环境. 2.安装本地jar 模板: mvn install:install-file -Dfile=<path-to-file& ...

  7. Spark SQL 编程API入门系列之Spark SQL支持的API

    不多说,直接上干货! Spark SQL支持的API SQL DataFrame(推荐方式,也能执行SQL) Dataset(还在发展) SQL SQL 支持basic SQL syntax/Hive ...

  8. vue中采用axios发送请求及拦截器

    这几天在使用vue中axios发送get请求的时候很顺手,但是在发送post请求的时候老是在成功的回调函数里边返回参数不存在,当时就纳闷了,经过查阅资料,终于得到了解决方案,在此做一总结: 首先我们在 ...

  9. vc6中关于“新建”

    1.windows api 编程:新建→工程→Win32 Application→一个空工程→新建→文件→C++ Source File2.windows mfc 编程:新建→工程→MFC AppWi ...

  10. CSS大纲