Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

cocos2d and Flash

(draft) Description: Define how the same task done in Flash would be done using cocos2d [ADDED BY: Robert Payne]: Some of these may have solutions that are easier but I have yet to find any: TIPS:

  1. PVRTC will rarely work for any Textures coming from Flash if you have Vector line work.
  2. “tint” in Flash is not like glColor4b or the colorizing features in cocos2d. To be able to colorize to any color the Texture has to be white.
  3. There is no magic MovieClip or easy way to mimic it. Nested looping animations are a bit time consuming to setup.
  4. There is an event dispatcher sort of see NSNotificationCenter in the API Documentation
  5. Learn to use TextureAtlas directly and manage your own draw calls. It allows for a lot more flexibility than trying to run animations through the Sprite or AtlasSprite especially when you get into nesting animations.
  6. If you have not already go look up “autorelease” “retain” or “release” and read the rest of the Garbage collection system it’ll save you years of time debugging memory issues.

[ADDED BY: Boon]:
Objective-C and Actionscript 3 (draft)

[ObjC] id is a pointer to any type of object
[AS3] Object

[ObjC] BOOL (values: YES | NO)
[AS3] Boolean (true | false)

[ObjC] nil
[AS3] (undefined | null)

[ObjC] The name of the class (specified in .h or .m) doesn’t have to match with the filename
[AS3] The name of the class HAS to match with the filename

View-based methods
[ObjC] addSubview
[AS3] addChild

[ObjC] bringSubviewToFront, bringSubviewToBack
[AS3] setChildIndex

[ObjC] removeFromSuperview
[AS3] parent.removeChild

[ObjC] exchangeSubviewAtIndex
[AS3] swapChildrenAt

convertPoint:fromView → localToGlobal, globalToLocal
convertPoint:toView → localToGlobal, globalToLocal
convertPoint:toView:nil → localToGlobal

[ObjC] setNeedsDisplay/setNeedsDisplayInRect
[AS3] stage.invalidate

[ObjC] setAnimationEnabled
[AS3] play/stop

[ObjC] UIView::hitTest
[AS3] displayObject.hitTest

[ObjC] UIView::pointInside
[AS3] objectsUnderPoint

[ObjC] userInteractionEnabled
[AS3] mouseEnabled

Dynamic method calling
[ObjC]
if( [obj respondsToSelector:@selector(method)] ) or NSSelectorFromString(method)
[obj performSelector:@selector(method)]; or [obj method];

[AS3]
if (obj.hasOwnProperty(method))
{
obj.method();
}

tips/flash_developers.txt · Last modified: 2011/03/01 01:41 by newacct
Trace: effects 0_99_0_rc download particles 0_99_5 0_99_4 0_99_1 0_9_0_beta index flash_developers
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0