Skip to content

Commit

Permalink
2222
Browse files Browse the repository at this point in the history
  • Loading branch information
heweitykc committed Aug 30, 2014
1 parent 953884d commit bc241a8
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 53 deletions.
56 changes: 56 additions & 0 deletions proj/generatefilelist/generatefilelist/drr_01.jpg.c3t

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions proj/generatefilelist/generatefilelist/drr_02.jpg.c3t

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions proj/generatefilelist/generatefilelist/drr_03.jpg.c3t

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions proj/动画资源/UI/DemoHead_UI/DemoHead_UI.xml.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@
<ProjectType>UIProject</ProjectType>
<ResRelativePath />
<imageFileList />
<imagePngList>
<string>BLOOD-1.png</string>
<string>hat01.png</string>
<string>hat.png</string>
<string>BLOOD-RED.png</string>
<string>BLOOD-BLUE.png</string>
<string>gun.png</string>
</imagePngList>
<imagePngList />
<JsonSuffix>.json</JsonSuffix>
<CurrentUIJson>DemoHead_UI.json</CurrentUIJson>
</UIProject>
13 changes: 3 additions & 10 deletions proj/动画资源/UI/DemoHead_UI/Json/DemoHead_UI.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@
"designHeight": 320,
"designWidth": 480,
"textures": [],
"texturesPng": [
"BLOOD-1.png",
"hat01.png",
"hat.png",
"BLOOD-RED.png",
"BLOOD-BLUE.png",
"gun.png"
],
"version": "1.4.0.1",
"texturesPng": [],
"version": "1.5.0.0",
"widgetTree": {
"classname": "Panel",
"name": null,
Expand Down Expand Up @@ -516,7 +509,7 @@
"classname": "Panel",
"name": "Panel",
"ZOrder": 0,
"actiontag": 1,
"actiontag": -1,
"anchorPointX": 0,
"anchorPointY": 0,
"classType": "CocoStudio.EngineAdapterWrap.CSPanel",
Expand Down
30 changes: 18 additions & 12 deletions proj/动画资源/cocos/isogrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,35 @@ bool IsoGrid::init()
_cellSize = 10;

_slider1 = Slider::create();
_slider1->setRotation(90);
_slider1->loadBarTexture("ui/sliderTrack.png");
_slider1->loadSlidBallTextures("ui/sliderThumb.png", "ui/sliderThumb.png", "");
_slider1->loadProgressBarTexture("ui/sliderProgress.png");
_slider1->setPosition(Vec2(70, 300));
_slider1->setPosition(Vec2(10, 500));
addChild(_slider1);
_slider1->addEventListener(CC_CALLBACK_2(IsoGrid::sliderEvent1, this));
_slider1->setPercent(50);

_slider2 = Slider::create();
_slider2->setRotation(90);
_slider2->loadBarTexture("ui/sliderTrack.png");
_slider2->loadSlidBallTextures("ui/sliderThumb.png", "ui/sliderThumb.png", "");
_slider2->loadProgressBarTexture("ui/sliderProgress.png");
_slider2->setPosition(Vec2(70, 280));
_slider2->setPosition(Vec2(30, 500));
addChild(_slider2);
_slider2->addEventListener(CC_CALLBACK_2(IsoGrid::sliderEvent2, this));
_slider2->setPercent(50);

_slider3 = Slider::create();
_slider3->setRotation(90);
_slider3->loadBarTexture("ui/sliderTrack.png");
_slider3->loadSlidBallTextures("ui/sliderThumb.png", "ui/sliderThumb.png", "");
_slider3->loadProgressBarTexture("ui/sliderProgress.png");
_slider3->setPosition(Vec2(70, 260));
_slider3->setPosition(Vec2(50, 500));
addChild(_slider3);
_slider3->addEventListener(CC_CALLBACK_2(IsoGrid::sliderEvent3, this));
_slider3->setPercent(50);

_label = LabelTTF::create("Hello World", "Arial", 8);
_label->setPosition(100, 310);
addChild(_label);

_items[0] = GridItem::create();
addChild(_items[0]);
_items[1] = GridItem::create();
Expand All @@ -71,12 +70,15 @@ bool IsoGrid::onTouchBegan(Touch* touch, Event* event)
{
Vec2 v2 = touch->getLocation();
v2 = this->convertToNodeSpace(v2);
char str0[256] = { 0 };

std::stringstream ss;
std::string str;

ss << "x=" << v2.x << ", y=" << v2.y << std::endl;;
ss >> str;
log(str.c_str());
Vec3 isop;
screen2iso(isop, Vec3(v2.x, v2.y, 0));
sprintf(str0, "x=%f,z=%f", round(isop.x), round(isop.z));
_label->setString(str0);

moveItem(0, isop.x, v2.y, isop.z);

return false;
Expand Down Expand Up @@ -169,16 +171,20 @@ void IsoGrid::redraw(float dt)
drawPoint(i, 0, j);
}
}

/*
char str0[256] = {0};
sprintf(str0, "xangle=%2f,yangle=%2f", _xangle, _yangle);
_label->setString(str0);

*/
moveItem(0, 0, 0, 0);
moveItem(1, 1, 0, 12);
moveItem(2, 2, 0, 12);
moveItem(3, 3, 0, 15);
moveItem(4, 4, 0, 12);
moveItem(5, 16, 0, 17);

CCNotificationCenter::sharedNotificationCenter()->postNotification("isogrid_resize", this);
}

void IsoGrid::iso2screen(Vec3& isoP, Vec3& screenP)
Expand Down
1 change: 0 additions & 1 deletion proj/动画资源/cocos/isogrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class IsoGrid : public cocos2d::Layer
cocos2d::ui::Slider* _slider1;
cocos2d::ui::Slider* _slider2;
cocos2d::ui::Slider* _slider3;
cocos2d::LabelTTF* _label;
GridItem* _items[6];

bool onTouchBegan(cocos2d::Touch*, cocos2d::Event*);
Expand Down
5 changes: 0 additions & 5 deletions proj/动画资源/cocos/road.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions proj/动画资源/cocos/road.h

This file was deleted.

Binary file added proj/动画资源/地图/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bc241a8

Please sign in to comment.