【Cocos2d TestCpp实例模仿一】-- ActionsTest
转载请注明出处:http://blog.csdn.net/oyangyufu/article/details/25252539
CCActionInterval(持续性动作) 位置性变化动作以To结束的, 表示精灵变化位置以绝对坐标为參考,左下角(0, 0);以By结尾,表示精灵精灵变化位置以相对坐标为參考,精灵当前所在位置为(0, 0)
移动动作(位置变化)
一、TestCpp实例ActionsTest 模块中ActionManual动作
素材原图:
动作效果图:
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); 设置猛兽白虎的x,y轴缩放、透明度
CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(1.0f);
sp1->setScaleX(1.0f);
sp1->setScaleY(-0.5f);
sp1->setPosition(ccp(200,visibleSize.height/2));
sp1->setOpacity(150);//透明度
this->addChild(sp1); 设置天使MM的旋转、自身为红色
CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setRotation(300);//旋转0~360
sp2->setColor(ccc3(255,0,0));
sp2->setPosition(ccp(visibleSize.width/2, visibleSize.height/2));
this->addChild(sp2); 设置猛兽灰狼的颜色为蓝色
CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setColor( ccBLUE);//(0,0,255)
sp3->setPosition(ccp(visibleSize.width-200, visibleSize.height/2));
this->addChild(sp3); return true;
}
二、TestCpp实例ActionsTest 模块中ActionRotate旋转动作
效果图:
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDi rector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); //******************************ActionRotate旋转*********************************
CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); //2s内将顺时针旋转45'
CCActionInterval *to = CCRotateTo::create(2.0f, 45);
CCActionInterval *to0 = CCRotateTo::create(2.0f, 0); //2s内将sp1逆时针旋转45'
CCActionInterval *to1 = CCRotateTo::create(2.0f, -45);
sp2->runAction(CCSequence::create(to, to1, NULL)); //旋转与回旋360'
CCActionInterval *by = CCRotateBy::create(2.0f, 360);
sp3->runAction(CCSequence::create(by, by->reverse(), NULL)); //先旋转360',再运行逆时针旋转45'(将top1动作在内存中拷贝一份运行,由于to1动画在sp2也在调用,原则两个精灵运行同一个动画,仅仅有最后面一个精灵调用)
sp1->runAction(CCSequence::create(by, to1->copy()->autorelease(), NULL)); return true;
}
三、TestCpp实例ActionsTest 模块中ActionScale缩放动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDi rector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); /******************************ActionScale缩放*********************************/
CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); //2s内放大2倍
CCActionInterval *to = CCScaleTo::create(2.0f, 2.0f);
//sp1->runAction(to); //2s内在原来基础上xy方向分别放大1倍和3倍
CCActionInterval *by = CCScaleBy::create(2.0f, 1.0f, 3.0f);
sp2->runAction(by); //2s内先xy方向放大3倍和1倍,再缩回到原来大小
CCActionInterval *bx = CCScaleBy::create(2.0f, 3.0f, 1.0f);
sp3->runAction(CCSequence::create(bx, bx->reverse(), NULL)); return true;
}
四、TestCpp实例ActionsTest 模块中ActionMove移动动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDi rector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); /******************************ActionMove移动*********************************/
//创建3怪兽,设置位置
CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); //2s内移动屏幕中心(绝对位置)
CCActionInterval *to = CCMoveTo::create(2.0f, ccp(visibleSize.width/2, visibleSize.height/2));
sp2->runAction(to); //2s内移动后再回到原点
CCActionInterval *by = CCMoveBy::create(2.0f, ccp(200, 200));//2s内相对它原来坐标,xy轴再移动200
CCActionInterval *byback = by->reverse();//反向播放动画
sp3->runAction(CCSequence::create(by, byback, NULL));//按序列运行动作,先相对移动,再反向回到原地 sp1->runAction(CCMoveTo::create(1.0f, ccp(100, 100))); return true;
}
五、TestCpp实例ActionsTest 模块中ActionJump缩放动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); /******************************ActionJump跳跃*********************************/ //參数1:持续时间;參数2:跳跃到的位置;參数3:跳跃高度;參数4:跳跃次数
CCActionInterval *to = CCJumpTo::create(2.0f, ccp(300, 0), 300, 2);
sp1->runAction(to); //跳跃回到原点
CCActionInterval *by = CCJumpBy::create(2.0f, ccp(300, 0), 100, 2);
CCActionInterval *backby = by->reverse();
sp2->runAction(CCSequence::create(by, backby, NULL)); //原地无限循环跳跃
CCActionInterval* actionUp = CCJumpBy::create(2, ccp(0,0), 80, 4);
sp3->runAction(CCRepeatForever::create(actionUp)); return true;
}
六、TestCpp实例ActionsTest 模块中ActionTint色值渐变动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); /******************************ActionTint色值渐变*********************************/
CCActionInterval *ac = CCTintTo::create(4, 255,255, 0);//4s渐变黄色
CCActionInterval *ac1 = CCTintBy::create(4, -255, 0, -255);//在眼下值上加上该色值,4s渐变绿 sp3->runAction(ac);
sp2->runAction(CCRepeatForever::create(CCSequence::create(ac1, ac1->reverse(), NULL))); return true;
}
七、TestCpp实例ActionsTest 模块中ActionBlink闪烁动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); /******************************ActionBlink闪烁*********************************/
CCActionInterval *ac = CCBlink::create(2, 4);//2s内闪烁4次
CCActionInterval *ac1 = CCBlink::create(5, 4);//5s内闪烁4次
sp2->runAction(ac);
sp3->runAction(ac1); return true;
}
八、TestCpp实例ActionsTest 模块中ActionFade谈入谈出动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); /******************************ActionFade谈入谈出*********************************/
sp1->setOpacity(0);//设置透明
CCActionInterval *in = CCFadeIn::create(2.0f);//谈入
sp1->runAction(CCSequence::create(in, in->reverse(), NULL)); CCActionInterval *out = CCFadeOut::create(2.0f);//谈出
sp2->runAction(CCSequence::create(out, in->reverse(), NULL)); sp3->setOpacity(100); return true;
}
九、TestCpp实例ActionsTest 模块中ActionBezier贝赛尔曲线动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); /******************************ActionBezier贝赛尔曲线*********************************/
//sprite 1
ccBezierConfig bezi;//配置贝赛尔曲线动作
bezi.controlPoint_1 = ccp(0, visibleSize.height/2);//控制点1位置
bezi.controlPoint_2 = ccp(300, -visibleSize.height/2);//控制点2位置
bezi.endPosition = ccp(300, 100); CCActionInterval * to = CCBezierBy::create(3, bezi);//參数1:持续时间;參数2:配置对象
CCAction *ac = CCRepeatForever::create(CCSequence::create(to, to->reverse(), NULL));
sp1->runAction(ac); //sprite 2
ccBezierConfig bezi1;
bezi1.controlPoint_1 = ccp(100, visibleSize.height/2);
bezi1.controlPoint_2 = ccp(200, -visibleSize.height/2);
bezi1.endPosition = ccp(500, 500);
CCActionInterval *to1 = CCBezierTo::create(3, bezi1);
sp2->runAction(to1); //sprite 3
sp3->setPosition(ccp(400,160));
CCActionInterval *to2 = CCBezierTo::create(3, bezi1);
sp3->runAction(to2); return true;
}
十、TestCpp实例ActionsTest 模块中ActionJump跳跃动作
程序代码:
bool HelloWorld::init()
{
if ( !CCLayer::init() )
{
return false;
} CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback)); pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2)); CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1); CCSprite *sp1 = CCSprite::create("cpp1.png");
sp1->setScale(0.5f);
sp1->setPosition(ccp(100, 100));
this->addChild(sp1); CCSprite *sp2 = CCSprite::create("cpp2.png");
sp2->setScale(0.5f);
sp2->setPosition(ccp(visibleSize.width/2-100, visibleSize.height/2));
this->addChild(sp2); CCSprite *sp3 = CCSprite::create("cpp3.png");
sp3->setScale(0.5f);
sp3->setPosition(ccp(visibleSize.width/2+100, visibleSize.height/2));
this->addChild(sp3); /******************************ActionJump跳跃*********************************/ //參数1:持续时间;參数2:跳跃到的位置;參数3:跳跃高度;參数4:跳跃次数
CCActionInterval *to = CCJumpTo::create(2.0f, ccp(300, 0), 300, 2);
sp1->runAction(to); //跳跃回到原点
CCActionInterval *by = CCJumpBy::create(2.0f, ccp(300, 0), 100, 2);
CCActionInterval *backby = by->reverse();
sp2->runAction(CCSequence::create(by, backby, NULL)); //原地无限循环跳跃
CCActionInterval* actionUp = CCJumpBy::create(2, ccp(0,0), 80, 4);
sp3->runAction(CCRepeatForever::create(actionUp)); return true;
}
【Cocos2d TestCpp实例模仿一】-- ActionsTest的更多相关文章
- 基于Cocos2d-x-1.0.1的飞机大战游戏开发实例(上)
最近接触过几个版本的cocos2dx,决定每个大变动的版本都尝试一下.本实例模仿微信5.0版本中的飞机大战游戏,如图: 一.工具 1.素材:飞机大战的素材(图片.声音等)来自于网络 2.引擎:coco ...
- 简单的scrapy实例
前天实验室的学长要求写一个简单的scrapy工程出来,之前也多少看了点scrapy的知识,但始终没有太明白,刚好趁着这个机会,加深一下对scrapy工作流程的理解.由于临近期末,很多作业要做(其实.. ...
- Highcharts入门小示例
一.创建条形图 1.创建div容器 <div id="container" style="min-width:800px;height:400px"> ...
- 【热门收藏】iOS开发人员必看的精品资料(100个)——下载目录
iPhone.iPad产品风靡全球,巨大的用户群刺激着iOS软件开发需求,然而国内人才缺口很大,正处于供不应求的状态,ios开发前景大好.我们整理了51CTO下载中心100份热门的ios开发资料,做了 ...
- java中线程池的使用方法
1 引入线程池的原因 由于线程的生命周期中包括创建.就绪.运行.阻塞.销毁阶段,当我们待处理的任务数目较小时,我们可以自己创建几个线程来处理相应的任务,但当有大量的任务时,由于创建.销毁线程需要很大的 ...
- iOS开发人员必看的精品资料(100个)
目录下载地址:http://down.51cto.com/data/416672 附件预览如下: iOS游戏开发之Unity3D引擎系列 http://down.51cto.com/zt/399 iP ...
- jquery树形菜单插件treeView
Jquery的treeview很好用,如果是简单的树形菜单按照下面的源码实例模仿就可以. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tr ...
- Python-全局解释器锁GIL原理和多线程产生原因与原理-多线程通信机制
GIL 全局解释器锁,这个锁是个粗粒度的锁,解释器层面上的锁,为了保证线程安全,同一时刻只允许一个线程执行,但这个锁并不能保存线程安全,因为GIL会释放掉的并且切换到另外一个线程上,不会完全占用,依据 ...
- javascript-初级-day08
return <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" ...
随机推荐
- Delphi XE6调用javascript
原文地址:Example of using JavaScript for Google maps in the Delphi XE6 XE6的TWebBrowser新增了EvaluateJavaS ...
- GDI+简单现实文字旋转
原文 http://www.cnblogs.com/kaixiangbb/p/3301272.html 题记 入职新公司已快有两月了,试用期已快结束,项目却迟迟还未正式启动.安排给我的多是些琐事,一直 ...
- 给ecshop后台增加管理功能页面
给ecshop后台增加管理功能页面 比如我们增加一个统计报表叫做 物流费用统计报表 放在后台“报表统计”栏目中 具体操作步骤: 第一步,我们要添加一个菜单到后台,然后设置语言项,最后设置权限,这样,后 ...
- aix5.1 5.2 5.3 6.1 7.1运维技术总结
++++++++++++++++++++++++++++ + Ruiy 20014-10 zz + +Technology Area; + Tel:150 55198367 + QQ:5160 591 ...
- UBUNTU 下如何升级 gcc, g++
正如大家所知道的GCC并不支持"make uninstall". 一种推荐安装方式就是把GCC 安装在你自己指定的一个路径,当你不须要某个GCC版本号的时候你仅仅须要移除相应版本号 ...
- DrawText的使用
DrawText函数简介 这个函数的作用非常easy,就是在指定的区域内输出格式化的文本. 函数原型: int DrawText( HDC hDC, LPCTSTR lpString, int nCo ...
- 设置IE兼容模式
文件兼容性用于定义让IE如何编译你的网页.此文件解释文件兼容性,如何指定你网站的文件兼容性模式以及如何判断一个网页该使用的文件模式. 前言 为了帮助确保你的网页在所有未来的IE版本都有一致的外观,IE ...
- mysql数据库日期是varchar类型的时间比较查询
单纯的字符串比较结果不精确. select * from 表明 where times> '2088/12/8 10:02:40' (×) 转换函数如下(数据库为varchar): selec ...
- bootstrap注意事项(五)表单
1.基本实例 单独的表单控件会被自动赋予一些全局样式.所有设置了 .form-control类的 <input>.<textarea> 和 <select> 元素都 ...
- js基础——cssText
以前,只知道设置css里的属性都是通过 元素.style.属性名 = 属性值 的方式,此时经常遇到的情况就是类似这样: var head= document.getElementById(&quo ...