本文整理汇总了C++中CSprite::SetPositionZ方法的典型用法代码示例。如果您正苦于以下问题:C++ CSprite::SetPositionZ方法的具体用法?C++ CSprite::SetPositionZ怎么用?C++ CSprite::SetPositionZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSprite
的用法示例。
在下文中一共展示了CSprite::SetPositionZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void SampleScene::Init()
{
g_CameraManager->AllCameraClear() ;
g_CameraManager->AddCamera(new CCamera(), 0) ;
g_CameraManager->AddCamera(new CCamera(), 1) ;
g_CameraManager->MovePosition(50.0f, 50.0f, 1) ;
Sprite.Init(50.0f, 50.0f, "sample_texture.png") ;
Sprite.SetTextureUV(0.0f, 0.0f, 50.0f, 50.0f) ;
Sprite.SetPositionZ(0.0f) ;
UISprite.Init(60.0f, 80.0f, "sample_texture2.png") ;
UISprite.Init("sample_texture2.png") ;
Sprite2.Init("sample_texture2.png") ;
UISprite2.Init("sample_texture2.png") ;
sound[0] = g_MusicManager->LoadMusic("click_1.mp3", false, false) ;
sound[1] = g_MusicManager->LoadMusic("click_2.mp3", false, false) ;
sound[2] = g_MusicManager->LoadMusic("eat.mp3", false, false) ;
}
示例2: Update
void SampleScene::Update(float dt)
{
g_Keyboard->Update() ;
g_Mouse->Update() ;
g_Joystick->Update() ;
g_MusicManager->Loop() ;
static float x=0.0f, y=0.0f ;
if(g_Keyboard->IsButtonDown(DIK_UP))
{
y += 1.5f ;
}
if(g_Keyboard->IsButtonDown(DIK_DOWN))
{
y -= 1.5f ;
}
if(g_Keyboard->IsButtonDown(DIK_RIGHT))
{
x += 1.5f ;
}
if(g_Keyboard->IsButtonDown(DIK_LEFT))
{
x -= 1.5f ;
}
if(g_Keyboard->IsButtonDown(DIK_1))
{
Sprite.SetTextureUV(0.0f, 0.0f, 50.0f, 50.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_2))
{
Sprite.SetTextureUV(50.0f, 0.0f, 100.0f, 50.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_3))
{
Sprite.SetTextureUV(0.0f, 50.0f, 50.0f, 100.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_4))
{
Sprite.SetTextureUV(50.0f, 50.0f, 100.0f, 100.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_8))
{
Sprite.SetPositionZ(0.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_9))
{
Sprite.SetPositionZ(1.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_0))
{
Sprite.SetPositionZ(0.5f) ;
}
if(g_Keyboard->IsButtonDown(DIK_5))
{
UISprite.SetPositionZ(0.0f) ;
UISprite2.SetPositionZ(0.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_6))
{
UISprite.SetPositionZ(1.0f) ;
UISprite2.SetPositionZ(0.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_7))
{
UISprite.SetPositionZ(0.0f) ;
UISprite2.SetPositionZ(1.0f) ;
}
if(g_Keyboard->IsButtonDown(DIK_F1))
{
g_CameraManager->SetCamera(0) ;
}
if(g_Keyboard->IsButtonDown(DIK_F2))
{
g_CameraManager->SetCamera(1) ;
}
if(g_Mouse->IsMouse(g_Mouse->LBUTTON_DOWN))
{
g_MusicManager->PlayMusic(sound[0]) ;
}
if(g_Mouse->IsMouse(g_Mouse->RBUTTON_DOWN))
{
g_MusicManager->PlayMusic(sound[2]) ;
}
if(g_Keyboard->IsButtonDown(DIK_SPACE))
{
g_MusicManager->PlayMusic(sound[1]) ;
}
/*if(g_Mouse->IsMouse(g_Mouse->LBUTTON_DOWN))
{
MessageBox(NULL, "LBUTTON_DOWN", "LBUTTON_DOWN", MB_OK) ;
}
if(g_Joystick->IsButtonDown(0))
//.........这里部分代码省略.........