mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' into develop_migrate_math_lib_merge
This commit is contained in:
commit
7a38050e09
2
AUTHORS
2
AUTHORS
|
@ -712,6 +712,7 @@ Developers:
|
|||
|
||||
kicktheken (Kenneth Chan)
|
||||
Fixed a bug that the setBlendFunc method of some classes wasn't exposed to LUA.
|
||||
Fix lua project template crash on iOS5.1 device
|
||||
|
||||
andyque
|
||||
Fixed a bug that missing to check self assignment of Vector<T>, Map<K,V>, Value and String.
|
||||
|
@ -813,6 +814,7 @@ Developers:
|
|||
|
||||
Mazyod
|
||||
Fixed a bug that HTTPClient reports 2xx status codes as errors
|
||||
Added missing Text Font and Placeholder feature of EditBox for Mac platform
|
||||
|
||||
iSevenDays
|
||||
Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG
|
||||
|
|
|
@ -1 +1 @@
|
|||
62ee83b9b745b3f49184d3f440092788aa97c795
|
||||
8b3507a9c91fab165e606013db661de54b2154d3
|
|
@ -31,8 +31,8 @@ Example:
|
|||
$ cd cocos2d-x
|
||||
$ ./setup.py
|
||||
$ source FILE_TO_SAVE_SYSTEM_VARIABLE
|
||||
$ cocos new MyGame -p com.your_company.mygame -l cpp -d /home
|
||||
$ cd /home/MyGame
|
||||
$ cocos new MyGame -p com.your_company.mygame -l cpp -d NEW_PROJECTS_DIR
|
||||
$ cd NEW_PROJECTS_DIR/MyGame
|
||||
|
||||
### Build and run new project for android ###
|
||||
|
||||
|
@ -56,7 +56,7 @@ script in **cocos2d/build/install-deps-linux.sh**
|
|||
|
||||
Then
|
||||
|
||||
$ cd /home/MyGame
|
||||
$ cd NEW_PROJECTS_DIR/MyGame
|
||||
$ cocos run -p linux
|
||||
|
||||
Run
|
||||
|
|
|
@ -1 +1 @@
|
|||
e6cb148185cfef8c71e62f3e83178e3eede69200
|
||||
5d8a34c4c77e112c1ec691319bce9afaae1a16f9
|
|
@ -279,7 +279,7 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat
|
|||
setSprite(Sprite::createWithTexture(_texture));
|
||||
|
||||
_texture->release();
|
||||
_sprite->setScaleY(-1);
|
||||
_sprite->setFlippedY(true);
|
||||
|
||||
_sprite->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED );
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ NS_CC_BEGIN
|
|||
|
||||
const char* cocos2dVersion()
|
||||
{
|
||||
return "3.0-rc2";
|
||||
return "cocos2d-x 3.0";
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -61,8 +61,7 @@ bool cocos2d::Image::saveToFile(const std::string& filename, bool isToRGB)
|
|||
|
||||
// The data has alpha channel, and want to save it with an RGB png file,
|
||||
// or want to save as jpg, remove the alpha channel.
|
||||
if ((saveToPNG && hasAlpha() && isToRGB)
|
||||
|| (! saveToPNG))
|
||||
if (hasAlpha() && bitsPerPixel == 24)
|
||||
{
|
||||
pixels = new unsigned char[myDataLength];
|
||||
|
||||
|
|
|
@ -18,42 +18,42 @@ public:
|
|||
void Close();
|
||||
|
||||
/**
|
||||
@brief 播放声音文件
|
||||
@param pFileName 播放的声音文件名称,需要包含文件的路径
|
||||
@param nTimes 播放声音文件的循环次数,默认值为 1,即播放一次
|
||||
@brief Play sound file
|
||||
@param pFileName Sound's file name,include the file path.
|
||||
@param nTimes Play mode£¬default value is 1,paly once
|
||||
*/
|
||||
void Open(const char* pFileName, UINT uId);
|
||||
|
||||
void Play(UINT uTimes = 1);
|
||||
|
||||
/**
|
||||
@brief 暂停播放声音
|
||||
@brief Pause play
|
||||
*/
|
||||
void Pause();
|
||||
|
||||
/**
|
||||
@brief 继续播放声音
|
||||
@brief Resume play
|
||||
*/
|
||||
void Resume();
|
||||
|
||||
/**
|
||||
@brief 停止播放声音
|
||||
@brief Stop play
|
||||
*/
|
||||
void Stop();
|
||||
|
||||
/**
|
||||
@brief 重新播放
|
||||
@brief Replay
|
||||
*/
|
||||
void Rewind();
|
||||
|
||||
/**
|
||||
@brief 获取播放器当前是否正在播放中
|
||||
@brief Is Playing
|
||||
*/
|
||||
bool IsPlaying();
|
||||
|
||||
/**
|
||||
@brief 获取当前播放的音效 ID
|
||||
@return 当前播放的音效ID
|
||||
@brief Get playing sound's ID
|
||||
@return Sound's ID
|
||||
*/
|
||||
UINT GetSoundID();
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
877f92ef1788ddee60729373e99035e25a6cdb5c
|
||||
b3b8c850b5895cbdb53da07310323c031c8b66c0
|
|
@ -1,29 +1,28 @@
|
|||
--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects.
|
||||
local M = {}
|
||||
local audioEngineInstance = cc.SimpleAudioEngine:getInstance()
|
||||
|
||||
function M.stopAllEffects()
|
||||
audioEngineInstance:stopAllEffects()
|
||||
cc.SimpleAudioEngine:getInstance():stopAllEffects()
|
||||
end
|
||||
|
||||
function M.getMusicVolume()
|
||||
return audioEngineInstance:getMusicVolume()
|
||||
return cc.SimpleAudioEngine:getInstance():getMusicVolume()
|
||||
end
|
||||
|
||||
function M.isMusicPlaying()
|
||||
return audioEngineInstance:isMusicPlaying()
|
||||
return cc.SimpleAudioEngine:getInstance():isMusicPlaying()
|
||||
end
|
||||
|
||||
function M.getEffectsVolume()
|
||||
return audioEngineInstance:getEffectsVolume()
|
||||
return cc.SimpleAudioEngine:getInstance():getEffectsVolume()
|
||||
end
|
||||
|
||||
function M.setMusicVolume(volume)
|
||||
audioEngineInstance:setMusicVolume(volume)
|
||||
cc.SimpleAudioEngine:getInstance():setMusicVolume(volume)
|
||||
end
|
||||
|
||||
function M.stopEffect(handle)
|
||||
audioEngineInstance:stopEffect(handle)
|
||||
cc.SimpleAudioEngine:getInstance():stopEffect(handle)
|
||||
end
|
||||
|
||||
function M.stopMusic(isReleaseData)
|
||||
|
@ -31,7 +30,7 @@ function M.stopMusic(isReleaseData)
|
|||
if nil ~= isReleaseData then
|
||||
releaseDataValue = isReleaseData
|
||||
end
|
||||
audioEngineInstance:stopMusic(releaseDataValue)
|
||||
cc.SimpleAudioEngine:getInstance():stopMusic(releaseDataValue)
|
||||
end
|
||||
|
||||
function M.playMusic(filename, isLoop)
|
||||
|
@ -39,19 +38,19 @@ function M.playMusic(filename, isLoop)
|
|||
if nil ~= isLoop then
|
||||
loopValue = isLoop
|
||||
end
|
||||
audioEngineInstance:playMusic(filename, loopValue)
|
||||
cc.SimpleAudioEngine:getInstance():playMusic(filename, loopValue)
|
||||
end
|
||||
|
||||
function M.pauseAllEffects()
|
||||
audioEngineInstance:pauseAllEffects()
|
||||
cc.SimpleAudioEngine:getInstance():pauseAllEffects()
|
||||
end
|
||||
|
||||
function M.preloadMusic(filename)
|
||||
audioEngineInstance:preloadMusic(filename)
|
||||
cc.SimpleAudioEngine:getInstance():preloadMusic(filename)
|
||||
end
|
||||
|
||||
function M.resumeMusic()
|
||||
audioEngineInstance:resumeMusic()
|
||||
cc.SimpleAudioEngine:getInstance():resumeMusic()
|
||||
end
|
||||
|
||||
function M.playEffect(filename, isLoop)
|
||||
|
@ -59,43 +58,51 @@ function M.playEffect(filename, isLoop)
|
|||
if nil ~= isLoop then
|
||||
loopValue = isLoop
|
||||
end
|
||||
return audioEngineInstance:playEffect(filename, loopValue)
|
||||
return cc.SimpleAudioEngine:getInstance():playEffect(filename, loopValue)
|
||||
end
|
||||
|
||||
function M.rewindMusic()
|
||||
audioEngineInstance:rewindMusic()
|
||||
cc.SimpleAudioEngine:getInstance():rewindMusic()
|
||||
end
|
||||
|
||||
function M.willPlayMusic()
|
||||
return audioEngineInstance:willPlayMusic()
|
||||
return cc.SimpleAudioEngine:getInstance():willPlayMusic()
|
||||
end
|
||||
|
||||
function M.unloadEffect(filename)
|
||||
audioEngineInstance:unloadEffect(filename)
|
||||
cc.SimpleAudioEngine:getInstance():unloadEffect(filename)
|
||||
end
|
||||
|
||||
function M.preloadEffect(filename)
|
||||
audioEngineInstance:preloadEffect(filename)
|
||||
cc.SimpleAudioEngine:getInstance():preloadEffect(filename)
|
||||
end
|
||||
|
||||
function M.setEffectsVolume(volume)
|
||||
audioEngineInstance:setEffectsVolume(volume)
|
||||
cc.SimpleAudioEngine:getInstance():setEffectsVolume(volume)
|
||||
end
|
||||
|
||||
function M.pauseEffect(handle)
|
||||
audioEngineInstance:pauseEffect(handle)
|
||||
cc.SimpleAudioEngine:getInstance():pauseEffect(handle)
|
||||
end
|
||||
|
||||
function M.resumeAllEffects(handle)
|
||||
audioEngineInstance:resumeAllEffects()
|
||||
cc.SimpleAudioEngine:getInstance():resumeAllEffects()
|
||||
end
|
||||
|
||||
function M.pauseMusic()
|
||||
audioEngineInstance:pauseMusic()
|
||||
cc.SimpleAudioEngine:getInstance():pauseMusic()
|
||||
end
|
||||
|
||||
function M.resumeEffect(handle)
|
||||
audioEngineInstance:resumeEffect(handle)
|
||||
cc.SimpleAudioEngine:getInstance():resumeEffect(handle)
|
||||
end
|
||||
|
||||
function M.getInstance()
|
||||
return cc.SimpleAudioEngine:getInstance()
|
||||
end
|
||||
|
||||
function M.destroyInstance()
|
||||
return cc.SimpleAudioEngine:destroyInstance()
|
||||
end
|
||||
|
||||
local modename = "AudioEngine"
|
||||
|
|
|
@ -414,8 +414,8 @@ _G.BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight
|
|||
_G.WidgetTypeWidget = ccui.WidgetType.widget
|
||||
_G.WidgetTypeContainer = ccui.WidgetType.container
|
||||
|
||||
_G.UI_TEX_TYPE_LOCAL = ccui.TextureResType.UI_TEX_TYPE_LOCAL
|
||||
_G.UI_TEX_TYPE_PLIST = ccui.TextureResType.UI_TEX_TYPE_PLIST
|
||||
_G.UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType
|
||||
_G.UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType
|
||||
|
||||
_G.TOUCH_EVENT_BEGAN = ccui.TouchEventType.began
|
||||
_G.TOUCH_EVENT_MOVED = ccui.TouchEventType.moved
|
||||
|
@ -449,15 +449,15 @@ _G.SCROLLVIEW_DIR_VERTICAL = ccui.ScrollViewDir.vertical
|
|||
_G.SCROLLVIEW_DIR_HORIZONTAL = ccui.ScrollViewDir.horizontal
|
||||
_G.SCROLLVIEW_DIR_BOTH = ccui.ScrollViewDir.both
|
||||
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.SCROLL_TO_TOP
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.SCROLL_TO_BOTTOM
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.SCROLL_TO_LEFT
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.SCROLL_TO_RIGHT
|
||||
_G.SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.SCROLLING
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.BOUNCE_TOP
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.BOUNCE_BOTTOM
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.BOUNCE_LEFT
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.BOUNCE_RIGHT
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.scrollToTop
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.scrollToBottom
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.scrollToLeft
|
||||
_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.scrollToRight
|
||||
_G.SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.scrolling
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft
|
||||
_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight
|
||||
|
||||
_G.PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning
|
||||
|
||||
|
|
|
@ -2,53 +2,54 @@
|
|||
|
||||
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
|
||||
|
||||
- [Misc Information](#misc-information)
|
||||
- [Requirements](#requirements)
|
||||
- [Runtime Requirements](#runtime-requirements)
|
||||
- [Compiler Requirements](#compiler-requirements)
|
||||
- [How to run TestCpp](#how-to-run-testcpp)
|
||||
- [Mac OSX & iOS](#mac-osx--ios)
|
||||
- [Android](#android)
|
||||
- [Windows](#windows)
|
||||
- [Linux](#linux)
|
||||
- [How to start a new game](#how-to-start-a-new-game)
|
||||
- [Highlights of v3.0](#highlights-of-v30)
|
||||
- [Features in detail](#features-in-detail)
|
||||
- [C++11 features](#c11-features)
|
||||
- [std::function](#stdfunction)
|
||||
- [Strongly typed enums](#strongly-typed-enums)
|
||||
- [override](#override)
|
||||
- [Removed Objective-C patterns](#removed-objective-c-patterns)
|
||||
- [No more 'CC' prefix for C++ classes and free functions](#no-more-cc-prefix-for-c-classes-and-free-functions)
|
||||
- [clone() instead of copy()](#clone-instead-of-copy)
|
||||
- [Singletons use getInstance() and destroyInstance()](#singletons-use-getinstance-and-destroyinstance)
|
||||
- [Object is replaced with Ref](#object-is-replaced-with-ref)
|
||||
- [getters](#getters)
|
||||
- [POD types](#pod-types)
|
||||
- [New Renderer](#new-renderer)
|
||||
- [Renderer features](#renderer-features)
|
||||
- [Auto-batching](#auto-batching)
|
||||
- [Auto-culling](#auto-culling)
|
||||
- [Global Z order](#global-z-order)
|
||||
- [Sprite vs. SpriteBatchNode](#sprite-vs-spritebatchnode)
|
||||
- [Improved LabelTTF / LabelBMFont / LabelAtlas](#improved-labelttf--labelbmfont--labelatlas)
|
||||
- [New EventDispatcher](#new-eventdispatcher)
|
||||
- [Physics Integration](#physics-integration)
|
||||
- [Misc API Changes](#misc-api-changes)
|
||||
- [ccTypes.h](#cctypesh)
|
||||
- [deprecated functions and global variables](#deprecated-functions-and--global-variables)
|
||||
- [Changes in the Lua bindings](#changes-in-the-lua-bindings)
|
||||
- [Use bindings-generator tool for lua binding](#use-bindings-generator-tool-for-lua-binding)
|
||||
- [Bind the classes with namespace to lua](#bind-the-classes-with-namespace-to-lua)
|
||||
- [Use ScriptHandlerMgr to manage the register and unregister of Lua function](#use-scripthandlermgr-to-manage-the-register-and-unregister-of-lua-function)
|
||||
- [Misc API changes](#misc-api-changes-1)
|
||||
- [Use cc、ccs、ccui gl and sp as module name](#use-ccccsccui-gl-and-sp-as-module-name)
|
||||
- [Modified functions](#modified-functions)
|
||||
- [Add some modules](#add-some-modules)
|
||||
- [Add more lua bindings](#add-more-lua-bindings)
|
||||
- [Replace some lua-bindings of Class or Struct with lua table](#replace-some-lua-bindings-of-class-or-struct-with-lua-table)
|
||||
- [Support lua script codes call Object-C codes and Java codes](#support-lua-script-codes-call-object-c-codes-and-java-codes)
|
||||
- [Add some lua files to store the constants of different modules](#add-some-lua-files-to-store-the-constants-of-different-modules)
|
||||
- [cocos2d-x v3.0 Release Notes](#user-content-cocos2d-x-v30-release-notes)
|
||||
- [Misc Information](#user-content-misc-information)
|
||||
- [Requirements](#user-content-requirements)
|
||||
- [Runtime Requirements](#user-content-runtime-requirements)
|
||||
- [Compiler Requirements](#user-content-compiler-requirements)
|
||||
- [How to run tests](#user-content-how-to-run-tests)
|
||||
- [Mac OSX & iOS](#user-content-mac-osx--ios)
|
||||
- [Android](#user-content-android)
|
||||
- [Windows](#user-content-windows)
|
||||
- [Linux](#user-content-linux)
|
||||
- [How to start a new game](#user-content-how-to-start-a-new-game)
|
||||
- [Highlights of v3.0](#user-content-highlights-of-v30)
|
||||
- [Features in detail](#user-content-features-in-detail)
|
||||
- [C++11 features](#user-content-c11-features)
|
||||
- [std::function](#user-content-stdfunction)
|
||||
- [Strongly typed enums](#user-content-strongly-typed-enums)
|
||||
- [override](#user-content-override)
|
||||
- [Removed Objective-C patterns](#user-content-removed-objective-c-patterns)
|
||||
- [No more 'CC' prefix for C++ classes and free functions](#user-content-no-more-cc-prefix-for-c-classes-and-free-functions)
|
||||
- [clone() instead of copy()](#user-content-clone-instead-of-copy)
|
||||
- [Singletons use getInstance() and destroyInstance()](#user-content-singletons-use-getinstance-and-destroyinstance)
|
||||
- [Object is replaced with Ref](#user-content-object-is-replaced-with-ref)
|
||||
- [getters](#user-content-getters)
|
||||
- [POD types](#user-content-pod-types)
|
||||
- [New Renderer](#user-content-new-renderer)
|
||||
- [Renderer features](#user-content-renderer-features)
|
||||
- [Auto-batching](#user-content-auto-batching)
|
||||
- [Auto-culling](#user-content-auto-culling)
|
||||
- [Global Z order](#user-content-global-z-order)
|
||||
- [Sprite vs. SpriteBatchNode](#user-content-sprite-vs-spritebatchnode)
|
||||
- [Improved LabelTTF / LabelBMFont / LabelAtlas](#user-content-improved-labelttf--labelbmfont--labelatlas)
|
||||
- [New EventDispatcher](#user-content-new-eventdispatcher)
|
||||
- [Physics Integration](#user-content-physics-integration)
|
||||
- [Misc API Changes](#user-content-misc-api-changes)
|
||||
- [ccTypes.h](#user-content-cctypesh)
|
||||
- [deprecated functions and global variables](#user-content-deprecated-functions-and--global-variables)
|
||||
- [Changes in the Lua bindings](#user-content-changes-in-the-lua-bindings)
|
||||
- [Use bindings-generator tool for lua binding](#user-content-use-bindings-generator-tool-for-lua-binding)
|
||||
- [Bind the classes with namespace to lua](#user-content-bind-the-classes-with-namespace-to-lua)
|
||||
- [Use ScriptHandlerMgr to manage the register and unregister of Lua function](#user-content-use-scripthandlermgr-to-manage-the-register-and-unregister-of-lua-function)
|
||||
- [Misc API changes](#user-content-misc-api-changes-1)
|
||||
- [Use cc、ccs、ccui gl and sp as module name](#user-content-use-ccccsccui-gl-and-sp-as-module-name)
|
||||
- [Modified functions](#user-content-modified-functions)
|
||||
- [Add some modules](#user-content-add-some-modules)
|
||||
- [Add more lua bindings](#user-content-add-more-lua-bindings)
|
||||
- [Replace some lua-bindings of Class or Struct with lua table](#user-content-replace-some-lua-bindings-of-class-or-struct-with-lua-table)
|
||||
- [Support lua script codes call Object-C codes and Java codes](#user-content-support-lua-script-codes-call-object-c-codes-and-java-codes)
|
||||
- [Add some lua files to store the constants of different modules](#user-content-add-some-lua-files-to-store-the-constants-of-different-modules)
|
||||
|
||||
# Misc Information
|
||||
|
||||
|
@ -74,7 +75,7 @@
|
|||
* gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required.
|
||||
* Visual Studio 2012 (for Windows)
|
||||
|
||||
## How to run TestCpp
|
||||
## How to run tests
|
||||
|
||||
### Mac OSX & iOS
|
||||
|
||||
|
@ -136,7 +137,7 @@ Run
|
|||
|
||||
## How to start a new game
|
||||
|
||||
Please refer to [ReadMe](../README.md)
|
||||
Please refer to [ReadMe](../README.md). And there is a [document](https://github.com/chukong/cocos-docs/blob/master/manual/framework/native/getting-started/v3.0/how-to-start-a-new-game/en.md) for it.
|
||||
|
||||
|
||||
# Highlights of v3.0
|
||||
|
@ -149,6 +150,7 @@ Please refer to [ReadMe](../README.md)
|
|||
* New UI objects
|
||||
* [JavaScript remote debugger](https://github.com/cocos2d/cocos-docs/blob/master/manual/framework/native/scripting/javascript/js-remote-debugger/en.md)
|
||||
* Remote Console support
|
||||
* Use [cocos console](https://github.com/cocos2d/cocos2d-console) to create and run project
|
||||
* Refactor Image - release memory in time and uniform the api of supported file format
|
||||
* Automatically generated Lua bindings, add LuaJavaBridge and LuaObjcBridge
|
||||
* Templated containers
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
}
|
||||
|
||||
@property(nonatomic, retain) NSTextField* textField;
|
||||
@property(nonatomic, retain) NSMutableDictionary* placeholderAttributes;
|
||||
@property(nonatomic, readonly, getter = isEditState) BOOL editState;
|
||||
@property(nonatomic, assign) void* editBox;
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
@implementation CCEditBoxImplMac
|
||||
|
||||
@synthesize textField = textField_;
|
||||
@synthesize placeholderAttributes = placeholderAttributes_;
|
||||
@synthesize editState = editState_;
|
||||
@synthesize editBox = editBox_;
|
||||
|
||||
|
@ -75,6 +76,7 @@
|
|||
[textField_ resignFirstResponder];
|
||||
[textField_ removeFromSuperview];
|
||||
self.textField = NULL;
|
||||
[placeholderAttributes_ release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -88,13 +90,17 @@
|
|||
editState_ = NO;
|
||||
self.textField = [[[CCCustomNSTextField alloc] initWithFrame: frameRect] autorelease];
|
||||
if (!textField_) break;
|
||||
[textField_ setTextColor:[NSColor whiteColor]];
|
||||
textField_.font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.
|
||||
NSFont *font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.
|
||||
textField_.textColor = [NSColor whiteColor];
|
||||
textField_.font = font;
|
||||
textField_.backgroundColor = [NSColor clearColor];
|
||||
[textField_ setup];
|
||||
textField_.delegate = self;
|
||||
[textField_ setDelegate:self];
|
||||
self.editBox = editBox;
|
||||
self.placeholderAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
font, NSFontAttributeName,
|
||||
[NSColor grayColor], NSForegroundColorAttributeName,
|
||||
nil];
|
||||
|
||||
[[[self getNSWindow] contentView] addSubview:textField_];
|
||||
|
||||
|
@ -293,18 +299,29 @@ bool EditBoxImplMac::initWithSize(const Size& size)
|
|||
|
||||
void EditBoxImplMac::setFont(const char* pFontName, int fontSize)
|
||||
{
|
||||
//TODO:
|
||||
// if(pFontName == NULL)
|
||||
// return;
|
||||
// NSString * fntName = [NSString stringWithUTF8String:pFontName];
|
||||
// UIFont *textFont = [UIFont fontWithName:fntName size:fontSize];
|
||||
// if(textFont != nil)
|
||||
// [_sysEdit.textField setFont:textFont];
|
||||
NSString * fntName = [NSString stringWithUTF8String:pFontName];
|
||||
NSFont *textFont = [NSFont fontWithName:fntName size:fontSize];
|
||||
if(textFont != nil)
|
||||
[_sysEdit.textField setFont:textFont];
|
||||
}
|
||||
|
||||
void EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize)
|
||||
{
|
||||
// TODO need to be implemented.
|
||||
NSString *fontName = [NSString stringWithUTF8String:pFontName];
|
||||
NSFont *font = [NSFont fontWithName:fontName size:fontSize];
|
||||
|
||||
if (!font) {
|
||||
CCLOGWARN("Font not found: %s", pFontName);
|
||||
return;
|
||||
}
|
||||
|
||||
_sysEdit.placeholderAttributes[NSFontAttributeName] = font;
|
||||
|
||||
/* reload placeholder */
|
||||
const char *placeholder = [_sysEdit.textField.cell placeholderAttributedString].string.UTF8String;
|
||||
if (placeholder) {
|
||||
setPlaceHolder(placeholder);
|
||||
}
|
||||
}
|
||||
|
||||
void EditBoxImplMac::setFontColor(const Color3B& color)
|
||||
|
@ -314,7 +331,14 @@ void EditBoxImplMac::setFontColor(const Color3B& color)
|
|||
|
||||
void EditBoxImplMac::setPlaceholderFontColor(const Color3B& color)
|
||||
{
|
||||
// TODO need to be implemented.
|
||||
NSColor *nsColor = [NSColor colorWithCalibratedRed:color.r/255.f green:color.g / 255.f blue:color.b / 255.f alpha:1.0f];
|
||||
_sysEdit.placeholderAttributes[NSForegroundColorAttributeName] = nsColor;
|
||||
|
||||
/* reload placeholder */
|
||||
const char *placeholder = [_sysEdit.textField.cell placeholderAttributedString].string.UTF8String;
|
||||
if (placeholder) {
|
||||
setPlaceHolder(placeholder);
|
||||
}
|
||||
}
|
||||
|
||||
void EditBoxImplMac::setInputMode(EditBox::InputMode inputMode)
|
||||
|
@ -357,7 +381,11 @@ const char* EditBoxImplMac::getText(void)
|
|||
|
||||
void EditBoxImplMac::setPlaceHolder(const char* pText)
|
||||
{
|
||||
[[_sysEdit.textField cell] setPlaceholderString:[NSString stringWithUTF8String:pText]];
|
||||
NSAttributedString *as = [[NSAttributedString alloc] initWithString:[NSString stringWithUTF8String:pText]
|
||||
attributes:_sysEdit.placeholderAttributes];
|
||||
|
||||
[[_sysEdit.textField cell] setPlaceholderAttributedString:as];
|
||||
[as release];
|
||||
}
|
||||
|
||||
NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vector2& designCoord, bool bInRetinaMode)
|
||||
|
|
|
@ -1 +1 @@
|
|||
e8281e5ccfc438a1d097b9704010312801ea192e
|
||||
16b3ab3a10ddab525554a84cff0bb4a04495256e
|
|
@ -73,11 +73,17 @@
|
|||
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
|
||||
cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView();
|
||||
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
|
||||
|
||||
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
|
||||
if (glview)
|
||||
{
|
||||
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
|
||||
|
||||
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
|
||||
if (eaglview)
|
||||
{
|
||||
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
|
||||
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//fix not hide status on ios7
|
||||
|
|
|
@ -76,6 +76,7 @@ public class AppActivity extends Cocos2dxActivity{
|
|||
public void onClick(DialogInterface dialog, int which) {
|
||||
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
|
||||
finish();
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
builder.setCancelable(false);
|
||||
|
|
|
@ -73,11 +73,17 @@
|
|||
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||
|
||||
cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView();
|
||||
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
|
||||
|
||||
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
|
||||
if (glview)
|
||||
{
|
||||
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
|
||||
|
||||
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
|
||||
if (eaglview)
|
||||
{
|
||||
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
|
||||
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//fix not hide status on ios7
|
||||
|
|
|
@ -1 +1 @@
|
|||
8e9998bc900f66fc53ba7d0c15c57e7c989a8ab9
|
||||
e016dc425c05838a9f9bbfc07a758c197691d505
|
|
@ -55,7 +55,8 @@ EditBoxTest::EditBoxTest()
|
|||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
_editPassword->setFont("American Typewriter", 30);
|
||||
#else
|
||||
_editPassword->setFont("fonts/American Typewriter.ttf", 30);
|
||||
_editPassword->setFont("American Typewriter", 80);
|
||||
_editPassword->setPlaceholderFont("American Typewriter", 80);
|
||||
#endif
|
||||
_editPassword->setFontColor(Color3B::GREEN);
|
||||
_editPassword->setPlaceHolder("Password:");
|
||||
|
|
|
@ -1176,12 +1176,14 @@ void TMXOrthoVertexZ::onEnter()
|
|||
|
||||
// TIP: 2d projection should be used
|
||||
Director::getInstance()->setProjection(Director::Projection::_2D);
|
||||
Director::getInstance()->setDepthTest(true);
|
||||
}
|
||||
|
||||
void TMXOrthoVertexZ::onExit()
|
||||
{
|
||||
// At exit use any other projection.
|
||||
Director::getInstance()->setProjection(Director::Projection::DEFAULT);
|
||||
Director::getInstance()->setDepthTest(false);
|
||||
TileDemo::onExit();
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ local function CocosDenshionTest()
|
|||
if event == "enter" then
|
||||
|
||||
elseif event == "exit" then
|
||||
--SimpleAudioEngine:getInstance():endToLua()
|
||||
AudioEngine.destroyInstance()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 70fa1ec93b56f535b9714392ddee7ca53c220bb1
|
||||
Subproject commit ad62fda3d74918f81df56c95ab91c05cc6a44814
|
|
@ -130,7 +130,7 @@ rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames ge
|
|||
Sprite::[initWithFile=init],
|
||||
SpriteBatchNode::[initWithFile=init],
|
||||
Touch::[getID=getId],
|
||||
SimpleAudioEngine::[preloadBackgroundMusic=preloadMusic setBackgroundMusicVolume=setMusicVolume getBackgroundMusicVolume=getMusicVolume playBackgroundMusic=playMusic stopBackgroundMusic=stopMusic pauseBackgroundMusic=pauseMusic resumeBackgroundMusic=resumeMusic rewindBackgroundMusic=rewindMusic isBackgroundMusicPlaying=isMusicPlaying willPlayBackgroundMusic=willPlayMusic],
|
||||
SimpleAudioEngine::[preloadBackgroundMusic=preloadMusic setBackgroundMusicVolume=setMusicVolume getBackgroundMusicVolume=getMusicVolume playBackgroundMusic=playMusic stopBackgroundMusic=stopMusic pauseBackgroundMusic=pauseMusic resumeBackgroundMusic=resumeMusic rewindBackgroundMusic=rewindMusic isBackgroundMusicPlaying=isMusicPlaying willPlayBackgroundMusic=willPlayMusic end=destroyInstance],
|
||||
FileUtils::[loadFilenameLookupDictionaryFromFile=loadFilenameLookup],
|
||||
Director::[end=endToLua]
|
||||
|
||||
|
|
Loading…
Reference in New Issue