starling gaming development

2015年6月19日 星期五 by Hu, Ching-Hsiang

because it's very important
so I need write it down
if you create a lot animation flash 2D game (include sprite sheet, video, particle)
most of time we will use starling to developer(GPU render)
but texture have resource limit
so my experience is :
1. 1280x720 (don't use 1920x1080)
2. StarlingSwf (very useful tools for timeline animation)
3. object pool (don't create object every time, or you need be sure texture dispose)

good luck have fun

Filed under having 0 意見  

starling gif decoder memory problem

2015年6月15日 星期一 by Hu, Ching-Hsiang

as3 starling gif decoder use https://github.com/honzabrecka/async-gif-decoder if you need refresh gif gallery all the time, or need show a lot gif image in same time use this library will have memory problem so you need modify "com/jx/gif/GPUGIF.as" change cachedTextures to public public var cachedTextures:Vector.; then in your code, every time refresh GPUGIF, you need if(gif.cachedTextures){ for(i=0;i < gif.cachedTextures.length;i++){ gif.cachedTextures[i].dispose(); } gif.dispose(); gif.texture.dispose(); } in this way, you can free 90% memory, if you have better way please let me know!! :)

Filed under having 0 意見  

starling right click

2015年6月10日 星期三 by Hu, Ching-Hsiang

starling/core/Starling.as case TouchEvent.TOUCH_END: phase = TouchPhase.ENDED; break; case MouseEvent.MOUSE_DOWN: phase = TouchPhase.BEGAN; break; case MouseEvent.MOUSE_UP: phase = TouchPhase.ENDED; break; + case MouseEvent.RIGHT_MOUSE_DOWN: phase = TouchPhase.RIGHT_BEGAN; break; + case MouseEvent.RIGHT_MOUSE_UP: phase = TouchPhase.RIGHT_ENDED; break; case MouseEvent.MOUSE_MOVE: phase = (mLeftMouseDown ? TouchPhase.MOVED : TouchPhase.HOVER); break; } ... ... ... if (!multitouchEnabled || Mouse.supportsCursor) - types.push(MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_UP); + types.push(MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_UP, MouseEvent.RIGHT_MOUSE_DOWN, MouseEvent.RIGHT_MOUSE_UP); return types; } starling/events/TouchPhase.as public static const HOVER:String = "hover"; + + /** Only available for mouse input: right mouse button was pressed */ + public static var RIGHT_BEGAN : String = "right_began" + + /** Only available for mouse input: right mouse button was released */ + public static const RIGHT_ENDED : String = "right_ended"; /** The finger touched the screen just now, or the mouse button was pressed. */ public static const BEGAN:String = "began";

Filed under having 0 意見