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


C++ HGE::Texture_Load方法代码示例

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


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

示例1: Init

void Projectile::Init(Ship* owner, PROJECTILE_TYPE type, float x, float y, float w, bool active)
{
	GameObject::Init(x, y, w, active);
	this->type = type;
	this->owner = owner;

	HGE* hge = hgeCreate(HGE_VERSION);

	switch (type)
	{
	case PROJ_BULLET:
		{
			tex = hge->Texture_Load("missile.png");
			sprite.reset(new hgeSprite(tex, 0, 0, 40, 20));
			sprite.get()->SetHotSpot(20, 10);
		}
		break;
	case PROJ_SEEKING_MISSLE:
		{
			tex = hge->Texture_Load("missile.png");
			sprite.reset(new hgeSprite(tex, 0, 0, 40, 20));
			sprite.get()->SetHotSpot(20, 10);
		}
		break;
	}

	hge->Release();
}
开发者ID:NothingMuch123,项目名称:Multiplayer-Assignment-2,代码行数:28,代码来源:Projectile.cpp

示例2: hgeCreate

HPBAR::HPBAR(const char* hp_tex, const char* shield_tex, const char* delay_tex)
{
	HGE *hge = hgeCreate(HGE_VERSION);
	tex1 = hge->Texture_Load(hp_tex);
	tex2 = hge->Texture_Load(shield_tex);
	tex3 = hge->Texture_Load(delay_tex);
	spr1 = new hgeSprite(tex1, 0, 0, 100, 17);
	spr2 = new hgeSprite(tex2, 0, 0, 100, 17);
	spr3 = new hgeSprite(tex3, 0, 0, 100, 17);
	spr3->SetColor(ARGB(255, 255, 0, 0));
	spr1->SetColor(ARGB(255, 0, 255, 0));
	spr2->SetColor(ARGB(255, 200, 200, 200));
	font = new hgeFont("font1.fnt");
	font->SetZ(SKILL_LAYER);
	font->SetScale(0.75);

}
开发者ID:Hiseen,项目名称:Old-Escope,代码行数:17,代码来源:HPBAR.cpp

示例3: hgeCreate

MUTI_POOL::MUTI_POOL(const char *flie,int nframes, float w, float h, float centerx, float centery)
{
	HGE *hge = hgeCreate(HGE_VERSION);
	HTEXTURE pic = hge->Texture_Load(flie);
	boom = new hgeAnimation(pic, nframes, 30, 0, 0, w, h);
	boom->SetZ(SKILL_LAYER);
	boom->SetHotSpot(centerx, centery);
}
开发者ID:Hiseen,项目名称:Old-Escope,代码行数:8,代码来源:MUTI_POOL.cpp

示例4: hgeCreate

BuffManager::BuffManager()
{
	HGE *hge = hgeCreate(HGE_VERSION);
	HTEXTURE f = hge->Texture_Load("freeze.png");
	HTEXTURE v = hge->Texture_Load("vertigo.png");
	HTEXTURE t = hge->Texture_Load("toxic.png");
	HTEXTURE m = hge->Texture_Load("MPrecover.png");
	HTEXTURE e = hge->Texture_Load("extraattack.png");
	toxicdebuff = new hgeSprite(t, 0, 0, BUFFSIZE, BUFFSIZE);
	vertigodebuff = new hgeSprite(v, 0, 0, BUFFSIZE, BUFFSIZE);
	freezedebuff = new hgeSprite(f, 0, 0, BUFFSIZE, BUFFSIZE);
	mprecover = new hgeSprite(m, 0, 0, BUFFSIZE, BUFFSIZE);
	extraattack = new hgeSprite(e, 0, 0, BUFFSIZE, BUFFSIZE);
	extraattack->SetHotSpot(1, 1);
	mprecover->SetHotSpot(1, 1);
	toxicdebuff->SetHotSpot(1, 1);
	vertigodebuff->SetHotSpot(1, 1);
	freezedebuff->SetHotSpot(1, 1);
	font = new hgeFont("font.fnt");
	m_bHasInitialized = true;
}
开发者ID:Hiseen,项目名称:HGE1,代码行数:21,代码来源:BuffManager.cpp

示例5: hgeCreate

AnimObject::AnimObject(const char *name, int nframes, int fps, float w, float h, float centerx, float centery, int aID,bool infinite, float x1, float y1)
{
	HGE* hge = hgeCreate(HGE_VERSION);
	tex = hge->Texture_Load(name);
	anim = new hgeAnimation(tex, nframes, fps, 0, 0, w, h);
	anim->SetHotSpot(centerx, centery);
	ID = aID;
	imgx = x1;
	imgy = y1;
	dead = false;
	angle = 0.0f;
	size = 1.0f;
	Isinfinite = infinite;
}
开发者ID:Hiseen,项目名称:HGE1,代码行数:14,代码来源:AnimObject.cpp

示例6: deleted

Missile::Missile(char* filename, float x, float y, float w, int shipid, int _damage)
	: angular_velocity(0)
	, deleted(0)
	, damage(_damage)
{
	HGE* hge = hgeCreate(HGE_VERSION);
	tex_ = hge->Texture_Load(filename);
	hge->Release();
	sprite_.reset(new hgeSprite(tex_, 0, 0, 40, 20));
	sprite_->SetHotSpot(20,10);
	x_ = x;
	y_ = y;
	w_ = w;
	ownerid = shipid;

	velocity_x_ = 200.0f * cosf(w_);
	velocity_y_ = 200.0f * sinf(w_); 

	x_ += velocity_x_ * 0.5;
	y_ += velocity_y_ * 0.5;

}
开发者ID:Pycorax,项目名称:MLGP_Assignment2,代码行数:22,代码来源:missile.cpp

示例7: SetBWbools

void ObjectPool::SetBWbools(const char* filename, int NumOfObject)
{
	HGE *hge = hgeCreate(HGE_VERSION);
	HTEXTURE pic = hge->Texture_Load(filename);
	int width = hge->Texture_GetWidth(pic);
	int height = hge->Texture_GetHeight(pic);
	BWpic bwpic;
	bwpic.width = width;
	bwpic.height = height;
	bwpic.bools = (bool**)malloc(sizeof(bool*)*width);
	for (int i = 0; i < width; i++)
		bwpic.bools[i] = (bool*)malloc(sizeof(bool)*height);
	DWORD *color = hge->Texture_Lock(pic);
	for (int i = 0; i < width; i++)
	for (int j = 0; j < height;j++)	
	if (GETR(color[j*width + i]) == 0 && GETG(color[j*width + i]) == 0 && GETB(color[j*width + i]) == 0)
		bwpic.bools[j][i] = true;
	else bwpic.bools[j][i] = false;
	bwpic.number = NumOfObject;
	hge->Texture_Unlock(pic);
	hge->Texture_Free(pic);
	BWpics.push_back(bwpic);
	BWpics.shrink_to_fit();
}
开发者ID:Hiseen,项目名称:HGE1,代码行数:24,代码来源:ObjectPool.cpp


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