PuzzleSDK
LightTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2013 cocos2d-x.org
3 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
4
5 http://www.cocos2d-x.org
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 THE SOFTWARE.
24 ****************************************************************************/
25
26#ifndef _LIGHT_TEST_H_
27#define _LIGHT_TEST_H_
28
29#include "../BaseTest.h"
30
32
33class LightTest : public TestCase
34{
35public:
37 LightTest();
38 virtual ~LightTest();
39
40 virtual std::string title() const override;
41
42 virtual void update(float delta) override;
43
44 void SwitchLight(cocos2d::Ref* sender, cocos2d::LightType lightType);
45
46private:
47
48 void addSprite();
49 void addLights();
50
51private:
52
53 cocos2d::AmbientLight* _ambientLight;
54 cocos2d::DirectionLight* _directionalLight;
55 cocos2d::PointLight* _pointLight;
56 cocos2d::SpotLight* _spotLight;
57
58 cocos2d::Label* _ambientLightLabel;
59 cocos2d::Label* _directionalLightLabel;
60 cocos2d::Label* _pointLightLabel;
61 cocos2d::Label* _spotLightLabel;
62};
63
64#endif
65
DEFINE_TEST_SUITE(LightTests)
cocos2d::Label * _pointLightLabel
Definition: LightTest.h:60
void SwitchLight(cocos2d::Ref *sender, cocos2d::LightType lightType)
Definition: LightTest.cpp:259
cocos2d::Label * _directionalLightLabel
Definition: LightTest.h:59
cocos2d::Label * _spotLightLabel
Definition: LightTest.h:61
cocos2d::DirectionLight * _directionalLight
Definition: LightTest.h:54
cocos2d::PointLight * _pointLight
Definition: LightTest.h:55
cocos2d::Label * _ambientLightLabel
Definition: LightTest.h:58
void addSprite()
Definition: LightTest.cpp:106
virtual ~LightTest()
Definition: LightTest.cpp:77
virtual void update(float delta) override
Definition: LightTest.cpp:230
cocos2d::AmbientLight * _ambientLight
Definition: LightTest.h:53
void addLights()
Definition: LightTest.cpp:166
cocos2d::SpotLight * _spotLight
Definition: LightTest.h:56
virtual std::string title() const override
Definition: LightTest.cpp:101
CREATE_FUNC(LightTest)