当前位置: 首页>>代码示例>>C++>>正文


C++ SpriteSheet::init方法代码示例

本文整理汇总了C++中SpriteSheet::init方法的典型用法代码示例。如果您正苦于以下问题:C++ SpriteSheet::init方法的具体用法?C++ SpriteSheet::init怎么用?C++ SpriteSheet::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SpriteSheet的用法示例。


在下文中一共展示了SpriteSheet::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setup

void TextTestApp::setup()
{
	hideBackground = false;
	activeUserPresent = false;
	// SET UP BLUR STUFF
	// setup our scene Fbo
	mFboScene = gl::Fbo( getWindowWidth(), getWindowHeight() );

	// setup our blur Fbo's, smaller ones will generate a bigger blur
	mFboBlur1 = gl::Fbo(getWindowWidth()/8, getWindowHeight()/8);
	mFboBlur2 = gl::Fbo(getWindowWidth()/8, getWindowHeight()/8);

	
	OutlineParams::getInstance()->init();

	// load and compile the shaders
	try { 
		mShaderBlur = gl::GlslProg( 
			loadFile("../shaders/blur_vert.glsl"),
			loadFile("../shaders/blur_frag.glsl")); 
	} catch(...) {
		console() << "Can't load/compile blur shader" << endl;
		quit();
	}

	try { 
		mShaderPhong = gl::GlslProg( 
			loadFile("../shaders/phong_vert.glsl"),
			loadFile("../shaders/phong_frag.glsl")); 
	} catch(...) {
		console() << "Can't load/compile phong shader" << endl;
		quit();
	}


	mTransform.setToIdentity();

	gestureTracker = GestureTracker::getInstance();

	gl::Texture::Format format;
	format.enableMipmapping(true);

	mCamera.setEyePoint( Vec3f(2.5f, 5.0f, 5.0f) );
	mCamera.setCenterOfInterestPoint( Vec3f(0.0f, 2.0f, 0.0f) );
	mCamera.setPerspective( 60.0f, getWindowAspectRatio(), 1.0f, 1000.0f );

	for (int i=0; i<40; i++)
	{
		CinderClip cinderClip = CinderClip();
		cinderClip.x = -200;
		cinderClip.y = -200;
		repelClips.push_back(cinderClip);

		////
	//	TweenParticle userParticle = TweenParticle(cinderClip.x, cinderClip.y,10,true);
		//userParticles.push_back(userParticle);
	}

	mbackground.setup();
	mbackground.setRepelClips( repelClips ); // I KNOW THEY ON SCREEN

	//load store config
	cinder::XmlTree configXml(ci::app::loadAsset( "shopconfig.xml" ) );
	ShopConfig::getInstance()->parseConfig(configXml);

	ci::gl::Texture bubbleManWaveTexture = cinder::loadImage(ci::app::loadResource(BUBBLEMAN_WAVE));

	mBubbleManWave = new SpriteSheet();
	mBubbleManWave->init(bubbleManWaveTexture, "./spritesheetdata/bubbleman_wave.xml", SpriteSheet::FORMAT_TEXTUREPACKER_GENERIC_XML);

	ci::gl::Texture bubbleManRunTexture = cinder::loadImage(ci::app::loadResource(BUBBLEMAN_RUN));
	mBubbleManRun = new SpriteSheet();
	mBubbleManRun->init(bubbleManRunTexture, "./spritesheetdata/bubbleman_run.xml", SpriteSheet::FORMAT_TEXTUREPACKER_GENERIC_XML);
	
	TextureGlobals::getInstance()->setSpriteSheet(mBubbleManRun,TextureGlobals::SPRITE_BUBBLEMAN_RUN);
	TextureGlobals::getInstance()->setSpriteSheet(mBubbleManWave,TextureGlobals::SPRITE_BUBBLEMAN_WAVE);

	gl::Texture particleTexture0 = loadImage(loadAsset( "ParticleFullON.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture0,0);

	gl::Texture particleTexture1 = loadImage(loadAsset( "ParticlePatial01.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture1,1);

	gl::Texture particleTexture2 = loadImage(loadAsset( "ParticlePatial02.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture2,2);

	gl::Texture particleTexture3 = loadImage(loadAsset( "ParticlePatial03.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture3,3);

	gl::Texture particleTexture4 = loadImage(loadAsset( "ParticlePatial04.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture4,4);

	gl::Texture particleTexture5 = loadImage(loadAsset( "ParticlePatial05.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture5,5);

	gl::Texture particleTexture6 = loadImage(loadAsset( "background-particle.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture6,6);

	gl::Texture particleTexture7 = loadImage(loadAsset( "ParticleFullONYellow.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture6,7);
//.........这里部分代码省略.........
开发者ID:proalias,项目名称:ee_app,代码行数:101,代码来源:TextTestApp.cpp


注:本文中的SpriteSheet::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。