How create vertical parallax background in android andengine -



How create vertical parallax background in android andengine -

i developing game in andegine , want create parallax background move top bottom in portrait mode parallax move right left or left right. have set engine options portrait_fixed or portrait_sensor. how accomplish task have searched options autoparallax , parallaxentity there no alternative set portrait , landscape mode of parallax

just found - http://www.andengine.org/forums/post306324.html#p31347

the guy has created 2 new classes autoverticalparallaxbackground , verticalparallaxbackground want! (i using it). can utilize verticalparallaxbackground or both depending on result :).

a vertical parallax background can implemented as:

mverticalparallaxbackground = new verticalparallaxbackground(0, 0, 0); mverticalparallaxbackground.attachverticalparallaxentity(new verticalparallaxentity(-5.0f, new sprite(0, screen_height - mresourcemanager.mparallaxlayerroad.getheight(), mresourcemanager.mparallaxlayerroad, mvertexbufferobjectmanager))); setbackground(mverticalparallaxbackground);

my illustration of using (for autoverticalparallaxbackground):

mautoverticalparallaxbackground .attachverticalparallaxentity(new verticalparallaxentity(-5.0f, new sprite(0, screen_height - mresourcemanager.mparallaxlayerroad .getheight(), mresourcemanager.mparallaxlayerroad, mvertexbufferobjectmanager))); setbackground(mautoverticalparallaxbackground);

i don't deserve credit answer. putting here other people can find easily!

android andengine

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -