android - Fastest way to do peripheral clipping -


in flash as3 app, using

    stage.scalemode = stagescalemode.show_all; 

because graphically want workable out-of-the-box in kinds of different mobile devices. works treat because "best-fit" device's screen , "adds" black borders around it.

for example, in 4:3 screens fills whole screen nicely: enter image description here

while in 16:9 screens black borders on left , right: enter image description here

now here problem: when moving display object "off-screen", don't want rendered inside black borders.

the question this: fastest way "clip" app - considering targeting mobile devices? have feeling a

stage.scrollrect 

will blow things performance-wise...

edit : using <rendermode>gpu</rendermode>

scrollrect great , makes application perform better, unless you're using gpu composition (in case degrades performance). i'd suggest trying first.

but alternative solution (as crazy sounds) have huge rectangle hole on on top of everything, last children of stage. suppose stage 640x480. you'd have black rectangle on top of dimensions of, say, 1640x1480, , hole of 640x480 pixels inside of let content visible. it's cheap way mimic mask without forcing recomposition of pixels inside area.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -