Forum > C++ > Implement some new features for cocos2d-1.0.1-x-0.10.0

Implement some new features for cocos2d-1.0.1-x-0.10.0

By tix Posted 2011-12-07 01:33 Comments 12
tix
  • Posts: 26

Hi,
I think most purpose to used cocos2d-x are to develop mobile games and I found some important
features that are lacked, such as “UIGestureRecognizer”, “XmlReader”, “ResourceManager”, etc.
So I implement some features for cocos2d-1.0.0.1-x-0.10.0

# EPNotificationCenter
# EPGestureRecognizerLayer
> # performTap
> # performLongPress
> # performPinch
> # performRotation
> # performPan
# EPXmlReader
# EPResourceManager
# Optimize the memory usage of textures in according to the prefix of file name. (4444*,565*,8888*,5A1*)
# File Templates, including CCLayer,CCScene, and EPGestureRecognizerLayer
#

I tried to attach the source code but always failed and how did I do to upload the source including the sample code ?

walzer
  • Posts: 1735
  • Location: Xiamen, China

#1 RE: 2011-12-08 16:05

They looks cool, especially NotificationCenter & GestureRecognizerLayer.
The limit size of attachment is 10MB, is your zip ball too large?

Less is More. Keep Focus.

tix
  • Posts: 26

#2 RE: 2011-12-08 17:01

I pack them to a patch file, cocos2dx.patch.To copy the patch file to cocos2dx folder and
apply it.
\$> patch p1i cocos2dx.patch

I modify some original source code of cocos2dx but all of them were marked as //Erawppa.
Maybe you will like and integrate them. :)

best regards.

cocos2dx.patch (2.1 MB)

tix
  • Posts: 26

#3 RE: 2011-12-08 17:04

I forgot sample code and uploaded :)

walzer
  • Posts: 1735
  • Location: Xiamen, China

#4 RE: 2011-12-10 06:34

Thanks! I will read the source in Monday.

Less is More. Keep Focus.

walzer
  • Posts: 1735
  • Location: Xiamen, China

#5 RE: 2011-12-12 02:14

Issue #909

Less is More. Keep Focus.

winipcfg
  • Posts: 141

#6 RE: 2012-02-06 06:06

Is the notification center class used for Notification Center in iphone?
I have checked the code and it is something like observer pattern.

tix
  • Posts: 26

#7 RE: 2012-02-06 06:25

ya, the notification center is like observer of iOS.
I have no idea any similar observer system in Android and I implement the similar pattern by using C++.
Hope I can use the same observer pattern in both OS. (not Java and Obj-C)

winipcfg
  • Posts: 141

#8 RE: 2012-02-08 03:47

The observer pattern is a nice feature. Just my 2 cents, the name EPNotificationCenter should be changed to something other than “Notification Center” if integrating into Cocos2dx. It is because someone might get confused to Notification Center in IOS (http://www.apple.com/iphone/features/notification-center.html). Someone needs the class name to implement Apple’s Notification Center.

BTW, are there Notification Center in other OS such as Android?

tix
  • Posts: 26

#9 RE: 2012-02-08 04:05

I totally agree what you say of naming issue and I think you can modify those codes in according to your requirement.

To develop Android App is my future plan and currently focus on iOS platform ,so I dont understand about Notification Center in Android. sorry.

dumganhar
  • Posts: 1000

#10 RE: 2012-02-09 06:16

Could you provide more demos about how to use EPScrollListLayer, EPTextFiled?
BTW, I have modified some of your code to make it suitable for the latest cocos2d-x code.
Here is my repository : https://github.com/dumganhar/cocos2d-x/tree/erawppa\_new\_feature

tix
  • Posts: 26

#11 RE: 2012-02-09 07:39

here are some files about EPScrollListLayer and there are three samples, including createScrollH() , createScrollV() , and createSyncScrollH()

I updated and fixed some codes in EPScrollListLayer.cpp/.h and you can replace them with attatchment.

btw, you can ignore EPTextField because there are some powerful samples in cocos2d-1.0.1-x-0.9.1/tests/tests/keypadTest. :)

dumganhar
  • Posts: 1000

#12 RE: 2012-02-09 08:32

Thank you. :)

Tix Lo wrote:

here are some files about EPScrollListLayer and there are three samples, including createScrollH() , createScrollV() , and createSyncScrollH()
>
I updated and fixed some codes in EPScrollListLayer.cpp/.h and you can replace them with attatchment.
>
btw, you can ignore EPTextField because there are some powerful samples in cocos2d-1.0.1-x-0.9.1/tests/tests/keypadTest. :)

Loggin to reply

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps