Commit Graph

308 Commits

Author SHA1 Message Date
leda 9b775e711d fix catch font name error when ttf font name with space (#1423)
* support catch fontName with space when canvas set font

* do same above on android

* improve regex

* add empty loadFont impl for win32 platform

* correct win32 parse font info regex on win32

* add win32 support ttf when font name = font face name

* another space line for win32 platforms

* improve regex when parse font name

* fix regex error

* correct typo
2018-07-26 17:57:25 +08:00
leda b242a1abd7 call recreate canvas buffer if needed when width/height changes (#1417)
* add more choice to call recreateBufferIfNeeded for canvas

* win32 - add more choice to call recreateBufferIfNeeded for canvas
2018-07-24 20:33:42 +08:00
leda 64643b4922 fix build crash on android when enable AnySDK (#1397)
* disable anysdk comments in link template

* extra init callback when JNI_OnLoad

* add some comment to explain both init function

* sync changes from link template to default for android
2018-07-19 09:55:51 +08:00
minggo 91719d5d94 convert data to RGBA888 when it is not (#1388) 2018-07-13 15:28:56 +08:00
leda fd29a5c395 fix android text render crash issue (#1379)
* prevent invalid canvas width and height set

* make restoreContext more stable

* improve canvas init for android
2018-07-10 18:14:06 +08:00
leda 74c85cf930 Fix win32 RichTextImage crash, and make test case works (#1376) 2018-07-06 17:25:06 +08:00
W-MTZing daab4eab46 fix locadlstorage api getlength (#1377) 2018-07-06 17:03:56 +08:00
W-MTZing 12d91c2f2d [feature] localStorage add api getKey and length (#1371) 2018-07-06 09:22:38 +08:00
minggo 3d51994bc8 readd jar files (#1350) 2018-06-29 15:47:06 +08:00
minggo 6c9b3f9b4a fix template compiling error on android (#1345) 2018-06-29 14:56:30 +08:00
minggo ea8a45b14f Merge branch 'next' of github.com:cocos-creator/cocos2d-x-lite into merge-develop 2018-06-28 17:49:31 +08:00
W-MTZing 715ac5ae73 [bug] vibrate api Compatible with the higher version SDK (#1341) 2018-06-28 17:48:41 +08:00
minggo 9705967973 move analytics codes to game activity 2018-06-28 16:05:04 +08:00
minggo 775d9c7803 Merge branch 'next' of github.com:cocos-creator/cocos2d-x-lite into merge-develop 2018-06-28 11:22:02 +08:00
leda 8a5db64163 correct label render contex2d (#1333)
* update label render

* refine code, easier to understand

* correct measure text error for Chinese characters

* comment debug info print

* format code style

* correct draw text length parameter
2018-06-27 18:07:57 +08:00
minggo 5b8919ccdf merge develop branch 2018-06-27 17:27:04 +08:00
leda 3d32cc3968 [Not Finished] win32 Text Rendering Context2D works (#1330)
* part added canvas interface

* try to re-use the font logic at device

* shows most simple label, works

* refine getTexture data

* add drawpoint convert

* correct point offset error

* refine method imput parameters

* little refine
2018-06-27 09:37:02 +08:00
minggo 09060d3709 fix size issue and typo (#1328) 2018-06-25 18:23:43 +08:00
leda 723f52a472 win32 link/default template compile and link pass, but not works when run (#1321)
* modify file changes on project config

* correct libcocos2d compile

* add win32 props back

* Revert "fix windows link template (#1138)"

This reverts commit 332d95e5b8.

* correct compile error

* many link errors need to be solved

* added part lack methods

* add empty impl for canvas rendering context 2d

* update main.cpp

* correct audio/network compile and link error

* sync win32 application logic with mac

* remove wrong change on application-win32

* correct win32 default-template compile and link error

* win32 simulator part compile error fixed

* editbox define changes
2018-06-22 10:19:31 +08:00
minggo 467b0346ce editbox support mac (#1322) 2018-06-21 09:25:56 +08:00
W-MTZing 888e1fb4d6 [adjust]change cocos2dxHelper.java function api vibrate SDK Version judgment (#1316) 2018-06-19 10:42:30 +08:00
James Chen 7264cdbdde Fix CC_TARGET_PLATFORM typo. (#1318) 2018-06-18 14:26:46 +08:00
leda 19552e0dd4 gen-simulator works on mac, but not full features (#1313)
* fix part of warnings

* avoid all compile errors

* remove part lua related

* remove useless comment

* add function to get glfwWindow

* improve comment

* correct group files at platform folder

* update gulp simulator script copy
2018-06-14 14:23:16 +08:00
leda 89901807a5 default template works on android studio (#1307)
* adapt android studio build config files, compile success

* remove hard coded sign info

* remove  -DHAVE_INSPECTOR, it have been defined in config.hpp

* remove anysdk related code

* revert wrong remove of anysdk and CocosAnalytics
2018-06-08 15:05:33 +08:00
Vincent Yang 8f6e9adbe1 [feature] CCDownloader add header and abort support. (#1291)
*  [feature] android implement recieve http header param, handle it in android http request (#2)

* [feature] Recieve http header param, handle it in android http request

* [feature] implement abort and header api

* /2.0 -> /2

* remove task when abort

*  [feature] Implement ios and mac downloader abort api (#3)

* [feature] Implement ios and mac downloader abort api

* use DLLOG to show log

* judge NSURLSessionTask state with NSURLErrorCancelled

* [adjust] Modify downloader from auto bind to manually (#4)

* [adjust] Modify Downloader createDownloadFileTask api from auto bind to manually

* Modify ini file

* [bug] fix Cocos2dxDownloader.java syntax error

* [bug] CCDownloader-android creatCoTask don't deleteLocalRef header str
2018-06-07 22:19:03 +08:00
minggo e356ce9225 fix bug that: (#1283)
touch outside of editbox will not close editbox
glsurface view may not has focus when finish editbox input
2018-06-04 11:06:07 +08:00
James Chen 0b85e67caf Supports text with bold. (#1282) 2018-06-02 18:46:12 +08:00
James Chen cad6cb9971 Uses the same CCCanvasRenderingContext2D for apple platforms (iOS/macOS). (#1281) 2018-06-02 17:52:54 +08:00
James Chen cf7f3770b7 Supports drawing path API and refactor CCCanvasRenderingContext2D for macOS. (#1280)
* Uses CGBitmapContextCreate instead of NSImage for macOS, the CCCanvasRenderingContext2D is similiar as which on iOS now.

* Supports drawing line API.

* Supports drawing line API for Android too.
2018-06-01 22:59:07 +08:00
minggo 5a06e1da7a send complete message when touch outside editbox (#1279) 2018-06-01 17:44:19 +08:00
minggo fbeb6dd200 Editbox ios support (#1278) 2018-06-01 14:12:03 +08:00
James Chen da45e32ada Removes unused files and code. (#1277) 2018-05-31 17:58:35 +08:00
James Chen 5245664704 Adds Device::getDeviceModel method. (#1276) 2018-05-31 14:13:28 +08:00
James Chen 712173a8de Supports DeviceMotionEvent and removes more unused code. (#1275)
* Binds Device class

* Removes ccFPSImage.c/h

* Updates Android.mk

* Supports DeviceMotionEvent and removes more unused code.

* Uses fprintf to implement SE_LOGD & SE_LOGE .
2018-05-31 14:08:20 +08:00
minggo 4ded383b8a fix crash of editbox on Android (#1273) 2018-05-30 14:51:56 +08:00
James Chen d54f1943b8 Keyboard Event works. (#1267)
* Keyboard Event works.

* Adds todo.

* temp commit for keyboard event.

* Keyboard event handle all keys.
2018-05-28 18:53:57 +08:00
minggo 7235644283 Editbox support (#1270)
can work on Android
2018-05-28 17:09:57 +08:00
James Chen 61accc6d11 Fixed the issue that text is probably cut. (#1268) 2018-05-28 11:45:07 +08:00
James Chen 73537df727 bufferWidth and bufferHeight check in CCCanvasRenderingContext2D. (#1262)
* Removes unused logic in EventDispatcher::dispatchTickEvent.

* Uses __jsbObj directly, dispatch enter background & foreground event

* bufferWidth and bufferHeight check in CCCanvasRenderingContext2D.
2018-05-24 14:38:55 +08:00
James Chen 1bb1806099 Supports Compressed Textures. (#1260)
* Updates CCConfiguration.h/.cpp.

* Supports Compressed Textures.

* Constructs Configuration singleton in Application constructor.

* Move Configuration::getInstance after createView.
2018-05-23 19:10:49 +08:00
James Chen 5f4e814ade Supports mouse event for desktop platforms. (#1256) 2018-05-22 14:03:54 +08:00
James Chen 442c149053 Implements Application::restart and some fixes. (#1253)
* Implements Application::restart.

* SAFE_DEC_REF should reset pointer to nullptr.

* Class::cleanup should be after of JSGlobalContextRelease.

* WebGLObject needs to be released if ScriptEngine is in cleanup process.

* Fixes memory leak in JSB_glGetActiveAttrib
2018-05-21 18:46:12 +08:00
James Chen 391e6e536e Supports text stroke for macOS, iOS and Android. (#1250)
* Supports stroke for mac.

* Supports text stroke for ios.

* Supports text stroke for android.

* typo fix in CanvasRenderingContext2DImpl.java.
2018-05-21 11:38:05 +08:00
minggo 8a76997242 adapt mac resolution (#1248) 2018-05-18 11:57:12 +08:00
minggo 4a13d0e15e Downsample (#1245)
* support render texture

* use texture unit 0

* add functions to set device pixel ratio

* add ccDeleteBuffers again

* fix according comments
2018-05-17 14:05:05 +08:00
James Chen 07cc734c8c setAnimationInterval -> setPreferredFramesPerSecond and binds setPreferredFramesPerSeconds. (#1244)
* setAnimationInterval -> setPreferredFramesPerSecond.

* Binds setPreferredFramesPerSeconds.

* typo fix in CCApplication-win32.cpp
2018-05-16 18:06:26 +08:00
James Chen 58361e1b2d Avoid to create canvas buffer twice. (#1242)
* Avoid to create canvas buffer twice.

* Remove unused condition code in Cocos2dxActivity.java
2018-05-15 11:00:52 +08:00
Vincent Yang 0bb96987e7 [bug] android nativeFinish don't release some object. (#1241) 2018-05-14 18:06:15 +08:00
James Chen 727a4911d4 [runtime] Adds jsb.openURL, __getOSVersion, __getCurrentLanguage interfaces. (#1238) 2018-05-11 16:03:17 +08:00
Vincent Yang bdb941eb4a [bug] some jni methods don't declare JNICALL modifier. (#1236) 2018-05-11 10:44:41 +08:00