您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetSprite函数代码示例

51自学网 2021-06-01 21:15:20
  C++
这篇教程C++ GetSprite函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetSprite函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSprite函数的具体用法?C++ GetSprite怎么用?C++ GetSprite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: GetSWFObject

/*========================idMenuScreen_Shell_Playstation::Update========================*/void idMenuScreen_Shell_Playstation::Update(){	if( menuData != NULL )	{		idMenuWidget_CommandBar* cmdBar = menuData->GetCmdBar();		if( cmdBar != NULL )		{			cmdBar->ClearAllButtons();			idMenuWidget_CommandBar::buttonInfo_t* buttonInfo;			buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY2 );			if( menuData->GetPlatform() != 2 )			{				buttonInfo->label = "#str_00395";			}			buttonInfo->action.Set( WIDGET_ACTION_GO_BACK );						buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY1 );			if( menuData->GetPlatform() != 2 )			{				buttonInfo->label = "#str_SWF_SELECT";			}			buttonInfo->action.Set( WIDGET_ACTION_PRESS_FOCUSED );		}	}		idSWFScriptObject& root = GetSWFObject()->GetRootObject();	if( BindSprite( root ) )	{		idSWFTextInstance* heading = GetSprite()->GetScriptObject()->GetNestedText( "info", "txtHeading" );		if( heading != NULL )		{			heading->SetText( "#str_swf_playstation" );			heading->SetStrokeInfo( true, 0.75f, 1.75f );		}				idSWFSpriteInstance* gradient = GetSprite()->GetScriptObject()->GetNestedSprite( "info", "gradient" );		if( gradient != NULL && heading != NULL )		{			gradient->SetXPos( heading->GetTextLength() );		}	}		if( btnBack != NULL )	{		btnBack->BindSprite( root );	}		idMenuScreen::Update();}
开发者ID:Anthony-Gaudino,项目名称:OpenTechBFG,代码行数:55,


示例2: CWidget

CTextInputWidget::CTextInputWidget( CWidget* parent, const types::rect& rect, bool relative , const types::id& id , const std::string& img_file, const std::string& cursor_img_file,  bool single_line ) :	CWidget( parent, rect, relative, id, img_file ),	myText(),	myCursorImageFile( cursor_img_file ),	myCursorSprite(),	myCursorPosition( 0 ),	myFocus( false ),	myIsPassword( false ){	Initialize( this, single_line );	if( GetSprite() )		mySpriteHandler->SetTextSingleLine( GetSprite(), single_line );}
开发者ID:acekiller,项目名称:poro,代码行数:14,


示例3: GetSprite

// Render//	- draw the entity's image at its position/*virtual*/ void Entity::Render( void ){	// Verify the image	//assert( m_hImage != SGD::INVALID_HANDLE && "Entity::Render - image was not set!" );		SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();		// Get the current frame	int frame = GetSprite()->GetCurrFrame();	// Find the center of the image	SGD::Vector center;	center.x = GetSprite()->GetFrame(frame).GetFrameRect().right - GetSprite()->GetFrame(frame).GetFrameRect().left;	center.y = GetSprite()->GetFrame(frame).GetFrameRect().bottom - GetSprite()->GetFrame(frame).GetFrameRect().top;	center.x /= 2;	center.y /= 2;	// Calculate the rotation	SGD::Vector rotate = m_vtVelocity;	rotate.Normalize();	float rot = SGD::Vector(0.0f, -1.0f).ComputeSteering(rotate);	float rotation = 0;	if(rot > 0)		rotation = SGD::Vector(0.0f, -1.0f).ComputeAngle(rotate);	else		rotation = -SGD::Vector(0.0f, -1.0f).ComputeAngle(rotate);		// Render	AnimationManager::GetInstance()->Render(m_antsAnimation, m_ptPosition.x - Camera::x, m_ptPosition.y - Camera::y, rotation, center);	// Why is this here?	SGD::Rectangle drawRect = GetRect();	drawRect.left -= Camera::x;	drawRect.right -= Camera::x;	drawRect.top -= Camera::y;	drawRect.bottom -= Camera::y;	// HACK: Modify the rotation	//m_fRotation += 0.01f;	// Draw the image	// -- Debugging Mode --	Game* pGame = Game::GetInstance();	if (pGame->IsShowingRects())		SGD::GraphicsManager::GetInstance()->DrawRectangle(drawRect, SGD::Color(128, 255, 0, 0));}
开发者ID:MatthewSalow,项目名称:soorry,代码行数:51,


示例4: DestroySprite

void HermiteSpline::Destroy(){	DestroySprite(GetSprite("start")->ID);//little ones	DestroySprite(GetSprite("player")->ID);//player	for (int i = 0; i < objectList.size(); i++)	{		delete objectList[i];	}	for (int i = 0; i < curvePoints.size(); i++)	{		delete curvePoints[i];	}}
开发者ID:JeffreyMJohnson,项目名称:exercises,代码行数:15,


示例5: GetSprite

void Bullet::Update(float frametime){	if(GetPosition().x < 0) { alive = false; }	if(GetPosition().y < 0) { alive = false; }	if(GetPosition().x > _state->getApp()->GetWidth()) { alive = false; }	if(GetPosition().y > _state->getApp()->GetHeight()) { alive = false; }	double radian = GetSprite().getRotation() * (pi / 180);	sf::Vector2f direction = sf::Vector2f((float)cos(radian), (float)sin(radian));	GetSprite().move(direction * speed * frametime);}
开发者ID:ChrisMelling,项目名称:basicGame,代码行数:15,


示例6: GetSWFObject

/*========================idMenuWidget_MenuBar::Update========================*/void idMenuWidget_MenuBar::Update() {	if ( GetSWFObject() == NULL ) {		return;	}	idSWFScriptObject & root = GetSWFObject()->GetRootObject();	if ( !BindSprite( root ) ) {		return;	}	totalWidth = 0.0f;	buttonPos = 0.0f;	for ( int index = 0; index < GetNumVisibleOptions(); ++index ) {					if ( index >= children.Num() ) {			break;		}		if ( index != 0 ) {			totalWidth += rightSpacer;		}		idMenuWidget & child = GetChildByIndex( index );		child.SetSpritePath( GetSpritePath(), va( "btn%d", index ) );		if ( child.BindSprite( root ) ) {			PrepareListElement( child, index );			child.Update();		}	}	// 640 is half the size of our flash files width	float xPos = 640.0f - ( totalWidth / 2.0f );	GetSprite()->SetXPos( xPos );	idSWFSpriteInstance * backing = GetSprite()->GetScriptObject()->GetNestedSprite( "backing" );	if ( backing != NULL ) {		if ( menuData != NULL && menuData->GetPlatform() != 2 ) {			backing->SetVisible( false );		} else {			backing->SetVisible( true );			backing->SetXPos( totalWidth / 2.0f );		}	}}
开发者ID:Deepfreeze32,项目名称:taken,代码行数:53,


示例7: GetShipSpriteSize

/** Get the size of the sprite of a ship sprite heading west (used for lists) * @param engine The engine to get the sprite from * @param width The width of the sprite * @param height The height of the sprite */void GetShipSpriteSize(EngineID engine, uint &width, uint &height){	const Sprite *spr = GetSprite(GetShipIcon(engine), ST_NORMAL);	width  = spr->width;	height = spr->height;}
开发者ID:andrew889,项目名称:OpenTTD,代码行数:12,


示例8: DrawShipEngine

void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal){	SpriteID sprite = GetShipIcon(engine);	const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);	preferred_x = Clamp(preferred_x, left - real_sprite->x_offs, right - real_sprite->width - real_sprite->x_offs);	DrawSprite(sprite, pal, preferred_x, y);}
开发者ID:andrew889,项目名称:OpenTTD,代码行数:7,


示例9: GetSprite

void Grenade::Render(){		// Get the current frame	int frame = GetSprite()->GetCurrFrame();	// Find the center of the image	SGD::Vector center;	center.x = GetSprite()->GetFrame(frame).GetFrameRect().right - GetSprite()->GetFrame(frame).GetFrameRect().left;	center.y = GetSprite()->GetFrame(frame).GetFrameRect().bottom - GetSprite()->GetFrame(frame).GetFrameRect().top;	center.x /= 2;	center.y /= 2;	// Render	AnimationManager::GetInstance()->Render(m_antsAnimation, m_ptPosition.x - Camera::x, m_ptPosition.y - Camera::y, m_fRotation, center);}
开发者ID:MatthewSalow,项目名称:soorry,代码行数:16,


示例10: GetSprite

//prints a number in sprite format//must be manually updated with sprite information//0 to 999999void CGraphics::PrintSpriteNumber(int x, int y, long num){  if (num < 0 || num > 999999)    return;  GRAPHIC_IMAGE gi;  int posX = x;  int posY = y;  std::string sRef = "0123456789";  std::ostringstream oss;  oss << num;  std::string sNum = oss.str();  std::string sPrefix;  if(sNum.length() < 6)    sPrefix.append(6 - sNum.length(), '0');  std::string sScore = sPrefix + sNum;  for(int i = 0; i < sScore.size();++i){    for(int j = 0; j < sRef.size(); ++j){      if(sScore.at(i) == sRef.at(j)){        gi = GetSprite(1200 + j);        RenderGraphicModulate(gi, posX, posY, 255, 255, 255);        posX += gi.width;        break;      }    }  }}
开发者ID:ChuckBolin,项目名称:JustAnotherTowerDefenseGame,代码行数:33,


示例11: GetVelocity

void ADefyingGravityCharacter::UpdateAnimation(){	const FVector PlayerVelocity = GetVelocity();	const float PlayerSpeed = PlayerVelocity.Size();	// Are we moving or standing still?	UPaperFlipbook* DesiredAnimation = (PlayerSpeed > 0.0f) ? catWalkAnimation : idleCatAnimation;	if (GetCharacterMovement()->IsFalling())	{		DesiredAnimation = JumpCatAnimation;	}	if( GetSprite()->GetFlipbook() != DesiredAnimation 	)	{		GetSprite()->SetFlipbook(DesiredAnimation);	}}
开发者ID:hanzes,项目名称:DefyingGravity,代码行数:16,


示例12: GetSprite

 TaskPtr BombGem::explosion() {     CCSprite* medium = GetSprite("fuze_1.png");     auto size = this->root->getContentSize();     medium->setAnchorPoint(ccp(0.5f, 0.5f));     //CCPoint pos = g2w_center(this->position);     medium->setPosition(ccp(Gem::kGemWidthPixel/2, Gem::kGemHeightPixel/2));     medium->setOpacity(0);     this->root->addChild(medium);          auto anim =     CCAnimationCache::sharedAnimationCache()->animationByName("skill_explosion");          auto hack = this->shared_from_this();     TaskSequencePtr seq = TaskSequence::make();     seq << TaskLambda::make([=]()                             {                                 medium->setOpacity(255);                             })     << TaskBatch::make(TaskAnim::make(medium,                                       CCAnimate::create(anim)),                        TaskAnim::make(this->root,                                       CCFadeOut::create(0.3f)))     << TaskLambda::make([=]()                         {                             auto self = hack;                         });          return seq; }
开发者ID:13609594236,项目名称:ph-open,代码行数:30,


示例13: GetField

void TToweredTrainUnit::GetDrawRect(TRect *r){    TRect r1;    TField *f = GetField(X, Y);    TSprite *s = GetSprite();    int rrx = GetRelX(X), rry = GetRelY(Y);    int drawx = 28 * (rrx - rry) + LittleX + 28;    int drawy = 14 * (rrx + rry - (f->Height)) + LittleY + 14;        r->x1 = drawx - s->dx, r->y1 = drawy - s->dy;    r->x2 = r->x1 + s->w, r->y2 = r->y1 + s->h;    s = UnitsSprites[Type][40 + WpnOrient];    r1.x1 = drawx + SpriteLocators[Type][SpriteOrient*2] - s->dx,     r1.y1 = drawy + SpriteLocators[Type][SpriteOrient*2+1] - s->dy;    r1.x2 = r1.x1 + s->w, r1.y2 = r1.y1 + s->h;    Union(r, &r1);    s = GetSmoke();    if (s) {        r1.x1 = drawx - s->dx, r1.y1 = drawy - s->dy;        r1.x2 = r1.x1 + s->w, r1.y2 = r1.y1 + s->h;        Union(r, &r1);    }}
开发者ID:danvac,项目名称:signus,代码行数:25,


示例14: Load

GameBall::GameBall(){	Load("Resources/Images/Ball.png");	assert(IsLoaded());	GetSprite().setOrigin(15, 15);}
开发者ID:SillenZ,项目名称:Pong,代码行数:7,


示例15: GetSWFObject

/*========================idMenuWidget_InfoBox::ObserveEvent========================*/void idMenuWidget_InfoBox::ResetInfoScroll() {	idSWFScriptObject & root = GetSWFObject()->GetRootObject();	if ( !BindSprite( root ) || GetSprite() == NULL ){		return;	}	idSWFTextInstance * txtBody = GetSprite()->GetScriptObject()->GetNestedText( "info", "txtBody" );	if ( txtBody != NULL ) {		txtBody->scroll = 0;	}	if ( scrollbar != NULL ) {		scrollbar->Update();	}}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:21,


示例16: UnitBottom

/* * UnitBottom *  * Calculate how low the unit can appear on the screen.  * It's partially based on the unit's size. */int UnitBottom (typUnit *unit){    typSprite *sprite;    sprite = GetSprite (unit);    return (GetGameHeight () - (sprite[0].height / 2));}
开发者ID:EVODelavega,项目名称:gtk-examples,代码行数:13,


示例17: GetSprite

void CMessageBoxScene::Draw(float dt){	LPD3DXSPRITE pSprite = GetSprite();	LPD3DXFONT pFont = GetFont();	// Darken down any other Scenes that were drawn beneath the popup.	float alpha = 1 - GetTransPos();	GetEngine()->DrawColourTint(D3DXCOLOR(0, 0, 0, alpha * 2 / 3));	// compute the sizes	RECT scr = GetEngine()->GetWindowRect();	D3DXVECTOR2 scrSize((float)scr.right, (float)scr.bottom);	D3DXVECTOR2 textSize = GetTextSize(pFont, mText.c_str());	D3DXVECTOR2 textPos = (scrSize - textSize) / 2;	const int VPAD = 16, HPAD = 32;	// padding	RECT bg;	bg.left = (int)textPos.x - HPAD;	bg.top = (int)textPos.y - VPAD;	bg.right = bg.left + (int)textSize.x + HPAD * 2;	bg.bottom = bg.top + (int)textSize.y + VPAD * 2;	D3DCOLOR col = D3DCOLOR_ARGB((int)(255 * alpha), 255, 255, 255);	pSprite->Begin(D3DXSPRITE_ALPHABLEND);	// must have ALPHABLEND or font looks awful	// stretch the 8x8 background into its area	DrawSprite(pSprite, mpTexture, bg, col);	// add text (using the sprite batch)	DrawD3DFontEx(pFont, pSprite, mText.c_str(), (int)textPos.x, (int)textPos.y,		col);	pSprite->End();}
开发者ID:crystalised,项目名称:GDEV,代码行数:31,


示例18: GetSWFObject

/*========================idMenuScreen_Shell_Leaderboards::Update========================*/void idMenuScreen_Shell_Leaderboards::Update() {	if ( menuData != NULL ) {		idMenuWidget_CommandBar * cmdBar = menuData->GetCmdBar();		if ( cmdBar != NULL ) {			cmdBar->ClearAllButtons();			idMenuWidget_CommandBar::buttonInfo_t * buttonInfo;			buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY2 );			if ( menuData->GetPlatform() != 2 ) {				buttonInfo->label = "#str_00395";			}			buttonInfo->action.Set( WIDGET_ACTION_GO_BACK );			buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY3 );			buttonInfo->label = "#str_online_leaderboards_toggle_filter";			buttonInfo->action.Set( WIDGET_ACTION_JOY3_ON_PRESS );						if ( !lbCache->IsLoadingNewLeaderboard() && !lbCache->IsRequestingRows() && options != NULL && options->GetTotalNumberOfOptions() > 0 ) {				buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY1 );				if ( menuData->GetPlatform() != 2 ) {					buttonInfo->label = "#str_swf_view_profile";				}				buttonInfo->action.Set( WIDGET_ACTION_PRESS_FOCUSED );			}		}			}	idSWFScriptObject & root = GetSWFObject()->GetRootObject();	if ( BindSprite( root ) ) {		idSWFTextInstance * heading = GetSprite()->GetScriptObject()->GetNestedText( "info", "txtHeading" );		if ( heading != NULL ) {			heading->SetText( lbCache->GetFilterStrType() );			heading->SetStrokeInfo( true, 0.75f, 1.75f );		}		idSWFSpriteInstance * gradient = GetSprite()->GetScriptObject()->GetNestedSprite( "info", "gradient" );		if ( gradient != NULL && heading != NULL ) {			gradient->SetXPos( heading->GetTextLength() );		}	}	if ( btnBack != NULL ) {		btnBack->BindSprite( root );	}	idMenuScreen::Update();}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:52,


示例19: SetPosition

void MessageBox::Draw(sf::RenderWindow& rw){	SetPosition(400, 720, true);	text.setPosition(GetPosition());	rw.draw(GetSprite());	rw.draw(text);}
开发者ID:minersail,项目名称:The-Unfortunate-Adventure-of-Joe,代码行数:8,


示例20: GetSprite

Bonus::Bonus(float X, float Y, int W, int H, sf::String Name):GameObject(X, Y, W, H, Name){	if (name == "Daemond")			{				GetSprite().setTextureRect(sf::IntRect(x, y, w, h));			}	//speed = 0;}
开发者ID:Anastatsia1213,项目名称:PlatformerGame,代码行数:8,


示例21: GetSprite

		void Renderer::Finalize()		{			GetSprite()->Finalize();			//GetLight()->Finalize();			//GetCamera()->Finalize();			GetTextRenderer()->Finalize();			FinalizeDevice();		}
开发者ID:tosik,项目名称:BlueCarrot,代码行数:8,


示例22: GetSprite

/*========================idMenuWidget_InfoBox::SetScroll========================*/void idMenuWidget_InfoBox::SetScroll( int scroll ) {	idSWFTextInstance * txtBody = GetSprite()->GetScriptObject()->GetNestedText( "info", "txtBody" );	if ( txtBody != NULL && scroll <= txtBody->maxscroll ) {		txtBody->scroll = scroll;	}}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:14,


示例23: SetScreenSize

		void Renderer::Initialize()		{			SetScreenSize(callback::GetScreenSize());			InitializeDevice();			GetTextRenderer()->Initialize();			GetCamera()->Initialize(GetGlobalInstance()->GetDeviceInformation());			GetLight()->Initialize(GetGlobalInstance()->GetDeviceInformation());			GetSprite()->Initialize(GetGlobalInstance()->GetDeviceInformation());		}
开发者ID:tosik,项目名称:BlueCarrot,代码行数:9,


示例24: GetSprite

 CCSprite *makeHeroImg(Hero *hero) {     CCSprite *img = GetSprite( hero->profile->bodyPath().c_str());     if(hero->profile->star < 5)         img->setScale(1.1);          img->setUserData(hero);     return img; }
开发者ID:13609594236,项目名称:ph-open,代码行数:9,


示例25: SpriteToQuad

//Рисуем прямоугольник и помещаем на него спрайтvoid SpriteToQuad(CCallParams& p){    GLfloat blend = 1.0f;    if (p.Size() > 7)        blend = p.AsFloat(7);    CBaseSprite* spr = GetSprite(p.AsString(0));    if (spr == 0)return;    spr->DrawQuad((size_t)p.AsInt(1), p.AsFloat(2), p.AsFloat(3),  p.AsFloat(4), p.AsFloat(5), p.AsFloat(6), blend);}
开发者ID:8441918,项目名称:evg-parser,代码行数:10,


示例26: UnitTop

/* * UnitTop *  * Calculate the maximum height of the unit based on the  * radar screen and the sprite size. */int UnitTop (typUnit *unit){    typSprite *sprite;    /* --- Get the sprite --- */    sprite = GetSprite (unit);    /* --- Add 1/2 sprite size to radar size. --- */    return (RADAR_HEIGHT + (sprite[0].height / 2));}
开发者ID:EVODelavega,项目名称:gtk-examples,代码行数:16,


示例27: GetSprite

void CModifiedButtonWidget::SetSelectionOn( bool value ){	if( mySelectionOn != value )	{		mySelectionOn = value;		const std::string animation = mySelectionOn?"select_mouse_out":"mouse_out";		mySpriteHandler->PlayAnimation( GetSprite(), animation );	}}
开发者ID:acekiller,项目名称:poro,代码行数:10,


示例28: GetVelocity

void AFlappyBirdCharacter::UpdateAnimation(){	const FVector PlayerVelocity = GetVelocity();	const float PlayerSpeed = PlayerVelocity.Size();	// Are we moving or standing still?	UPaperFlipbook* DesiredAnimation = (PlayerSpeed > 0.0f) ? RunningAnimation : IdleAnimation;	GetSprite()->SetFlipbook(DesiredAnimation);}
开发者ID:rjp0008,项目名称:unreal-playground,代码行数:10,



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


C++ GetSquared函数代码示例
C++ GetSpellStore函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。