#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. 在 Eclipse 中使用 C++

    安装 安装Eclipse Eclipse下载页 能够选择Eclipse IDE for C/C++ Developers(内置CDT插件) 也能够选择安装其它版本号之后再安装CDT插件. 安装CDT插 ...

  2. JavaSE 最easy出错的几个简单的问题

    案例1. package cn.itcast.oop; public class ThisDemo { public static void main(String[] args) { Student ...

  3. 信息安全-加密:SM4.0

    ylbtech-信息安全-加密:SM4.0 SM4.0(原名SMS4.0)是中华人民共和国政府采用的一种分组密码标准,由国家密码管理局于2012年3月21日发布.相关标准为“GM/T 0002-201 ...

  4. 杂项-公司:YKK

    ylbtech-杂项-公司:YKK YKK的全称为Yoshida Kogyo Kabushikigaisha.YKK是拉链行业的鼻祖,代表着行业标准,因为采用日本精确的工艺,原料和管理方法,YKK价格 ...

  5. Thread.setDaemon设置说明

    转载地址:http://blog.csdn.net/m13666368773/article/details/7245570 Thread.setDaemon的用法,经过学习以后了解: 1. setD ...

  6. 15. 3Sum[M]三数之和

    题目 Given an array nums of n integers, are three elements a, b, c in nums such that a+b+c=0? Find all ...

  7. redis的主从模式

    主从通信过程 Master配置: 1:关闭rdb快照(备份工作交给slave) 2:可以开启aof slave配置: 1: 声明slave-of slaveof 192.168.0.102 2: 配置 ...

  8. MySQL中的存储函数和存储过程的简单示例

    存储函数 定义 CREATE FUNCTION `fn_sum`(`a` int,`b` int) RETURNS int(11) BEGIN RETURN a + b; END 调用 Navicat ...

  9. hdu 2795 Billboard 【线段树】

    给出一个高为h,宽为w的广告板,有n张广告需要贴,从第一行开始贴,尽量靠左,输出每个广告最后贴在哪一行的 先一直想不通这样建树是为什么 后来看到一篇题解里面的一句话“直到找到一个满足条件的叶子节点” ...

  10. EM_LGH CF965D Single-use Stones 思维_推理

    Code: #include<cstdio> #include<algorithm> using namespace std; const int maxn = 1000000 ...