newlist

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2013年6月20日

摘要: //编码转换 //#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) // string title = "成绩"; // GBK2UTF8(title,"gb2312","utf-8"); //#endif static int GBK2UTF8(std::string & gbkStr, const char* toCode, const char* fromCode) { iconv_t iconvH; iconvH = iconv_open(fromCo... 阅读全文
posted @ 2013-06-20 12:03 一枚程序 阅读(504) 评论(0) 推荐(0)

摘要: /****************************************************************************Copyright (c) 2010 cocos2d-x.orghttp://www.cocos2d-x.orgPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin t 阅读全文
posted @ 2013-06-20 11:21 一枚程序 阅读(1381) 评论(0) 推荐(0)

摘要: //转换坐标 //锚点为(x,x)是的坐标转换成锚点为(0,0)的坐标 //例如:把锚点(0.5,0.5)坐标(0,0)转换成 //锚点(0.5,0.5)坐标(0 - pNode.getContentSize.width * 0.5,0 - pNode.getContentSize.Height * 0.5) static void anchorToLocalPos(CCNode* pNode) { pNode->setPositionX(pNode->getPositionX() + pNode->getContentSize().width * ... 阅读全文
posted @ 2013-06-20 10:07 一枚程序 阅读(544) 评论(0) 推荐(0)