#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. 0x31 质数

    poj2689 算根号R的质数,然后把L~R区间(这个很小啊)的合数判下 #include<cstdio> #include<iostream> #include<cst ...

  2. Swift - 使用CollectionView实现图片Gallery画廊效果(左右滑动浏览图片)

    1,效果图 (1)图片从左至右横向排列(只有一行),通过手指拖动可以前后浏览图片. (2)视图滚动时,每张图片根据其与屏幕中心距离的不同,显示尺寸也会相应地变化.越靠近屏幕中心尺寸就越大,远离屏幕中心 ...

  3. Windows系统安装MySQL5.5.21图解教程

    大家都知道MySQL是一款中.小型关系型数据库管理系统,很具有实用性,对于我们学习很多技术都有帮助 数据库是5.5.21这个版本的.以下是安装步骤: 1.首先单击MySQL5.5.21的安装文件,出现 ...

  4. No changes detected or App 'blog' could not be found. Is it in INSTALLED_APPS?

    出现该问题的原因: django没有在setting.py的配置文件中找到app内容,需要增加app的名称 E:\PycharmProjects\Mysite>python manage.py ...

  5. 剑指offer——01二维数组中的查找(Python3)

    题目:在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数. ...

  6. 新手配置vux

    1.首先跟平常一样创建一个vue的项目 2.开始配置vux 第一步 安装vux npm install vux --save 第二步  安装vux-loader npm install vux-loa ...

  7. Caffe Batch Normalization推导

    Caffe BatchNormalization 推导 总所周知,BatchNormalization通过对数据分布进行归一化处理,从而使得网络的训练能够快速并简单,在一定程度上还能防止网络的过拟合, ...

  8. Html5必看:教你如何选择移动APP开发框架

    如何选择移动APP开发框架一直是困扰很多新手的难题,今天杭州APP开发小编就和大家一起分享一下HTML5 移动app开发过程中框架该如何选择?当然我们得先从下面几个方面来评估一个框架的优越性,然后再做 ...

  9. cache(缓存)的作用

    cache的作用: 连接文件.内存与应用,为信息流在三者之间流动提供通道: 存储管理:对外与对内: 存取效率: 多线程: 一次存储:分批存储? 系统的缓存控制机制(虚拟内存)使用分段分页与命中机制. ...

  10. 数据库过滤操作中 != 或者 <> 指定操作数并不能改匹配到NULL值

    数据库过滤操作中 != 或者 <> 指定操作数并不能改匹配到NULL值