[Modify] Visible로 업데이트 및 랜더 조정
[Modify] IMGUI로 부모 자식들 조절
This commit is contained in:
@@ -8,6 +8,7 @@ int g_iImageCount;
|
||||
float g_fFar;
|
||||
float g_fTime;
|
||||
float g_fFrame;
|
||||
float g_Alpha;
|
||||
float g_fDeltaU;
|
||||
float g_fDeltaV;
|
||||
uint g_iIndexU;
|
||||
@@ -74,32 +75,32 @@ PS_OUT PS_Cursor(PS_IN In) // 마우스 커서
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // Out에 출력하기 위한 값
|
||||
float4 White = float4(1.f, 1.f, 1.f, 1.f); // 마지막에 하얀색으로 바꿔주기 위한 값
|
||||
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // Out에 출력하기 위한 값
|
||||
float4 White = float4(1.f, 1.f, 1.f, 1.f); // 마지막에 하얀색으로 바꿔주기 위한 값
|
||||
|
||||
float2 UV = In.vTexcoord; // UV를 돌리기 위해서 받아옴
|
||||
float2 Center = float2(0.5f, 0.5f); // 이미지를 회전 하기 전에 중심으로 옮길 값
|
||||
float2 UV = In.vTexcoord; // UV를 돌리기 위해서 받아옴
|
||||
float2 Center = float2(0.5f, 0.5f); // 이미지를 회전 하기 전에 중심으로 옮길 값
|
||||
|
||||
float CW = -g_fTime; // 시계 방향
|
||||
float CCW = g_fTime; // 반시계 방향
|
||||
float CW = -g_fTime; // 시계 방향
|
||||
float CCW = g_fTime; // 반시계 방향
|
||||
|
||||
float2 RedCircle = UV; // 빨간 원을 반시계 방향으로 돌려주기 위한 준비
|
||||
float2 RedUV = UV - Center; // 중심으로 옮겨줌
|
||||
float2 RedCircle = UV; // 빨간 원을 반시계 방향으로 돌려주기 위한 준비
|
||||
float2 RedUV = UV - Center; // 중심으로 옮겨줌
|
||||
// 값을 돌리기 위해서 회전 행렬을 만들어 준다.
|
||||
RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); // x축은 x*cos(각도) - y*sin(각도)
|
||||
RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); // y축은 x*sin(각도) + y*cos(각도)
|
||||
RedCircle = RedCircle + Center; // 이제 위에서 다 돌려주면 다시 중심에서 원점으로 옮겨준다.
|
||||
RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); // x축은 x*cos(각도) - y*sin(각도)
|
||||
RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); // y축은 x*sin(각도) + y*cos(각도)
|
||||
RedCircle = RedCircle + Center; // 이제 위에서 다 돌려주면 다시 중심에서 원점으로 옮겨준다.
|
||||
|
||||
float2 BlueCircle = UV; // 파란색은 시계 방향으로 돌려준다
|
||||
float2 BlueUV = UV - Center; // 중심으로 옮겨줌
|
||||
float2 BlueCircle = UV; // 파란색은 시계 방향으로 돌려준다
|
||||
float2 BlueUV = UV - Center; // 중심으로 옮겨줌
|
||||
// 값을 돌리기 위해서 회전 행렬을 만들어 준다.
|
||||
BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); // x축은 x*cos(각도) - y*sin(각도)
|
||||
BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); // y축은 x*sin(각도) + y*cos(각도)
|
||||
BlueCircle = BlueCircle + Center; // 이제 위에서 다 돌려주면 다시 중심에서 원점으로 옮겨준다.
|
||||
BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); // x축은 x*cos(각도) - y*sin(각도)
|
||||
BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); // y축은 x*sin(각도) + y*cos(각도)
|
||||
BlueCircle = BlueCircle + Center; // 이제 위에서 다 돌려주면 다시 중심에서 원점으로 옮겨준다.
|
||||
|
||||
// 두개 다 같은 이미지 인데 원의 색상이 2개임
|
||||
float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); // 큰 원은 빨간색임
|
||||
float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); // 작은 원은 파란색임
|
||||
float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); // 큰 원은 빨간색임
|
||||
float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); // 작은 원은 파란색임
|
||||
|
||||
if (Texture1.r >= 0.7f) // 우선 빨간 원을 먼저 그려준다.
|
||||
Color = Texture1;
|
||||
@@ -121,22 +122,22 @@ PS_OUT PS_Sptire_Sheet(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // 최종 이미지 출력
|
||||
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // 최종 이미지 출력
|
||||
|
||||
float2 UV = In.vTexcoord; // 이미지의 UV값
|
||||
float2 UV = In.vTexcoord; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = g_iImageCount * g_iImageCount; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
int iTotalFrame = g_iImageCount * g_iImageCount; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame; // 현재 프레임이 어디 위치인지
|
||||
int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame; // 현재 프레임이 어디 위치인지
|
||||
|
||||
int iFrameX = iCurrentFrame % g_iImageCount; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / g_iImageCount; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
int iFrameX = iCurrentFrame % g_iImageCount; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / g_iImageCount; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / g_iImageCount; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / g_iImageCount; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
float fFreamWidth = 1.0 / g_iImageCount; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / g_iImageCount; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
float4 Texture = g_Texture.Sample(DefaultSampler, UV);
|
||||
|
||||
@@ -169,6 +170,8 @@ PS_OUT PS_Key_Hold(PS_IN In)
|
||||
|
||||
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
|
||||
if (Color.r >= 0.3f)
|
||||
Color.rgb = Grey;
|
||||
|
||||
|
||||
@@ -117,6 +117,8 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
|
||||
m_fSizeXY = static_cast<CElementObject*>(m_pElementObject)->Get_Current_Size();
|
||||
|
||||
m_fEndTime = static_cast<CElementObject*>(m_pElementObject)->Get_EndTime();
|
||||
m_fDelayTime = static_cast<CElementObject*>(m_pElementObject)->Get_DelayTime();
|
||||
m_fTimeMult = static_cast<CElementObject*>(m_pElementObject)->Get_TimeMult();
|
||||
}
|
||||
GUI::Begin("Current_PanelObject_Info");
|
||||
@@ -124,28 +126,46 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGamePlay_Canvas != nullptr)
|
||||
{
|
||||
m_bCanvasVisible = static_cast<CCanvasObject*>(m_pGamePlay_Canvas)->Get_Visible();
|
||||
auto panelNames = static_cast<CCanvasObject*>(m_pGamePlay_Canvas)->Panel_Name();
|
||||
PanelwstringTostring(panelNames);
|
||||
if (GUI::Combo("Panels", &m_iPanelCount, m_iPanelName.data(), static_cast<_int>(m_iPanelName.size())))
|
||||
{
|
||||
m_pPanelObject = static_cast<CCanvasObject*>(m_pGamePlay_Canvas)->Get_Panel(m_iPanelNamewstring[m_iPanelCount]);
|
||||
}
|
||||
if (GUI::Checkbox("Canvas Active", &m_bCanvasVisible))
|
||||
{
|
||||
static_cast<CCanvasObject*>(m_pGamePlay_Canvas)->Visible(m_bCanvasVisible);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pPanelObject != nullptr)
|
||||
{
|
||||
if (m_bCanvasVisible == false)
|
||||
{
|
||||
m_bPanelVisible = m_bCanvasVisible;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bPanelVisible = static_cast<CPanelObject*>(m_pPanelObject)->Get_Visible();
|
||||
}
|
||||
if (GUI::Checkbox("Panel Active", &m_bPanelVisible))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->Visible(m_bPanelVisible);
|
||||
}
|
||||
|
||||
GUI::Text("Origin Position : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Origin_Position().x, static_cast<CUIObject*>(m_pPanelObject)->Get_Origin_Position().y);
|
||||
GUI::Text("Current Position : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Position().m128_f32[0], static_cast<CUIObject*>(m_pPanelObject)->Get_Current_Position().m128_f32[1]);
|
||||
GUI::Text("Origin Size : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Origin_Size().x, static_cast<CUIObject*>(m_pPanelObject)->Get_Origin_Size().y);
|
||||
GUI::Text("Current Size : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Size().x, static_cast<CUIObject*>(m_pPanelObject)->Get_Current_Size().y);
|
||||
|
||||
GUI::Text("PanelPosition");
|
||||
if (GUI::SliderFloat("X##PanelPos", &m_fPanelPos.x, 0.f, 1920.f))
|
||||
if (GUI::SliderFloat("X##PanelPos", &m_fPanelPos.x, -1920.f, 1920.f))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->MoveX(m_fPanelPos.x);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Y##PanelPos", &m_fPanelPos.y, 0.f, 1080))
|
||||
if (GUI::SliderFloat("Y##PanelPos", &m_fPanelPos.y, -1080.f, 1080))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->MoveY(m_fPanelPos.y);
|
||||
}
|
||||
@@ -186,21 +206,35 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pElementObject = static_cast<CPanelObject*>(m_pPanelObject)->Get_Element(m_pElementNamewstring[m_iElementCount]);
|
||||
}
|
||||
|
||||
}
|
||||
if (m_pElementObject != nullptr)
|
||||
{
|
||||
if (m_bPanelVisible == false)
|
||||
{
|
||||
m_bElementVisible = m_bPanelVisible;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bElementVisible = static_cast<CElementObject*>(m_pElementObject)->Get_Visible();
|
||||
}
|
||||
if (GUI::Checkbox("Panel Active", &m_bElementVisible))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Visible(m_bElementVisible);
|
||||
}
|
||||
|
||||
GUI::Text("Origin Position : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Origin_Position().x, static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Position().y);
|
||||
GUI::Text("Current Position : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Current_Position().m128_f32[0], static_cast<CUIObject*>(m_pElementObject)->Get_Current_Position().m128_f32[1]);
|
||||
GUI::Text("Origin Size : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Origin_Size().x, static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Size().y);
|
||||
GUI::Text("Current Size : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Current_Size().x, static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size().y);
|
||||
|
||||
GUI::Text("Position");
|
||||
if (GUI::SliderFloat("X##Pos", &m_fPos.x, 0.f, 1920.f))
|
||||
if (GUI::SliderFloat("X##Pos", &m_fPos.x, -1920.f, 1920.f))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->MoveX(m_fPos.x);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Y##Pos", &m_fPos.y, 0.f, 1080))
|
||||
if (GUI::SliderFloat("Y##Pos", &m_fPos.y, -1080.f, 1080))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->MoveY(m_fPos.y);
|
||||
}
|
||||
@@ -222,6 +256,16 @@ void CIMGUIUI::Update(_float fTimeDelta)
|
||||
static_cast<CElementObject*>(m_pElementObject)->SizeUpdate_float(m_fSizeXY);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("EndTime", &m_fEndTime, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_TimeMult(m_fEndTime);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("m_fDelayTime", &m_fDelayTime, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_TimeMult(m_fDelayTime);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("TimeMult", &m_fTimeMult, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_TimeMult(m_fTimeMult);
|
||||
|
||||
@@ -21,8 +21,8 @@ HRESULT CLoadingWidget::Initialize(void* pArg)
|
||||
{
|
||||
CUIObject::UIOBJECT_DESC Desc{};
|
||||
|
||||
Desc.fX = 1800.f;
|
||||
Desc.fY = 850.f;
|
||||
Desc.fX = 600.f;
|
||||
Desc.fY = 0.f;
|
||||
Desc.fSizeX = 200.f;
|
||||
Desc.fSizeY = 200.f;
|
||||
|
||||
@@ -45,17 +45,28 @@ HRESULT CLoadingWidget::Initialize(void* pArg)
|
||||
|
||||
void CLoadingWidget::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CLoadingWidget::Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
return;
|
||||
|
||||
m_fTime += fTimeDelta * m_fTimeMult;
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CLoadingWidget::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_bVisible) {
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::UI, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
|
||||
@@ -3,28 +3,28 @@
|
||||
#include "GameInstance.h"
|
||||
|
||||
CLoadingWidget_Flame::CLoadingWidget_Flame(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CElementObject(pDevice, pContext)
|
||||
:CElementObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CLoadingWidget_Flame::CLoadingWidget_Flame(const CLoadingWidget_Flame& rhs)
|
||||
:CElementObject(rhs)
|
||||
:CElementObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CLoadingWidget_Flame::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoadingWidget_Flame::Initialize(void* pArg)
|
||||
{
|
||||
CUIObject::UIOBJECT_DESC Desc{};
|
||||
|
||||
Desc.fX = 1800.f;
|
||||
Desc.fY = 850.f;
|
||||
Desc.fSizeX = 200.f;
|
||||
Desc.fSizeY = 200.f;
|
||||
Desc.fX = -237.f;
|
||||
Desc.fY = 90.f;
|
||||
Desc.fSizeX = 100.f;
|
||||
Desc.fSizeY = 100.f;
|
||||
|
||||
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
|
||||
|
||||
@@ -39,23 +39,52 @@ HRESULT CLoadingWidget_Flame::Initialize(void* pArg)
|
||||
|
||||
m_iImageFrameX = 3;
|
||||
m_fFrame = 0.2f;
|
||||
m_fEndTime = 1.8f;
|
||||
m_fTimeMult = 3.f;
|
||||
m_fDelay = 1.f;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CLoadingWidget_Flame::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CLoadingWidget_Flame::Update(_float fTimeDelta)
|
||||
{
|
||||
m_fTime += fTimeDelta * m_fTimeMult;
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_fDelay >= 0.f)
|
||||
{
|
||||
m_fDelay -= fTimeDelta * m_fTimeMult;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fTime += fTimeDelta * m_fTimeMult;
|
||||
}
|
||||
|
||||
if (m_fTime >= m_fEndTime)
|
||||
{
|
||||
m_fTime = 0.f;
|
||||
m_fDelay = 1.f;
|
||||
}
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CLoadingWidget_Flame::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_bVisible) {
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::UI, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
@@ -116,6 +145,10 @@ HRESULT CLoadingWidget_Flame::Bind_ShaderResources()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iImageCount", &m_iImageFrameX, sizeof(_int))))
|
||||
{
|
||||
return E_FAIL;
|
||||
|
||||
@@ -23,10 +23,10 @@ HRESULT CLoading_Panel::Initialize(void* pArg)
|
||||
{
|
||||
CUIObject::UIOBJECT_DESC Desc{};
|
||||
|
||||
Desc.fX = 0.f;
|
||||
Desc.fY = 0.f;
|
||||
Desc.fSizeX = 100.f;
|
||||
Desc.fSizeY = 100.f;
|
||||
Desc.fX = 1200.f;
|
||||
Desc.fY = 900.f;
|
||||
Desc.fSizeX = 1515.f;
|
||||
Desc.fSizeY = 300.f;
|
||||
|
||||
if (FAILED(__super::Initialize(&Desc)))
|
||||
{
|
||||
@@ -45,38 +45,33 @@ HRESULT CLoading_Panel::Initialize(void* pArg)
|
||||
|
||||
void CLoading_Panel::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CLoading_Panel::Update(_float fTimeDelta)
|
||||
{
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CLoading_Panel::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible) {
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::UI, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
if (!__super::Chack_Visible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CLoading_Panel::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pVIBufferCom->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -87,26 +82,6 @@ _vector CLoading_Panel::Get_WorldPostion()
|
||||
|
||||
HRESULT CLoading_Panel::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -117,15 +92,7 @@ HRESULT CLoading_Panel::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Keyboard_0"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -175,8 +142,6 @@ void CLoading_Panel::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ class CIMGUIUI final : public CGameObject
|
||||
_float2 m_fPos{};
|
||||
_float2 m_fSize{};
|
||||
_float3 m_fSizeXY{};
|
||||
_float m_fEndTime{};
|
||||
_float m_fDelayTime{};
|
||||
_float m_fTimeMult{};
|
||||
|
||||
_float2 m_fPanelPos{};
|
||||
@@ -57,6 +59,10 @@ class CIMGUIUI final : public CGameObject
|
||||
vector<string> m_iPanelNamestring;
|
||||
vector<const _char*> m_iPanelName;
|
||||
|
||||
_bool m_bCanvasVisible = { false };
|
||||
_bool m_bPanelVisible = { false };
|
||||
_bool m_bElementVisible = { false };
|
||||
|
||||
public:
|
||||
static CIMGUIUI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
|
||||
@@ -26,6 +26,9 @@ class CLoadingWidget_Flame final : public CElementObject
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
//virtual _bool Chack_Visible() override;
|
||||
|
||||
private:
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
@@ -33,6 +36,8 @@ class CLoadingWidget_Flame final : public CElementObject
|
||||
|
||||
_int m_iImageFrameX{};
|
||||
_float m_fFrame{};
|
||||
_float m_fDelay{};
|
||||
|
||||
public:
|
||||
static CLoadingWidget_Flame* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
|
||||
@@ -31,8 +31,6 @@ class CLoading_Panel final : public CPanelObject
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
CGameObject* m_pLoadingWidget = { nullptr };
|
||||
CGameObject* m_pLoadingWidget_Flame = { nullptr };
|
||||
|
||||
@@ -66,15 +66,7 @@ HRESULT CCanvasObject::Ready_Panel(void* pArg)
|
||||
|
||||
void CCanvasObject::Visible(_bool bVisible)
|
||||
{
|
||||
if (m_Panels.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto iter : m_Panels)
|
||||
{
|
||||
static_cast<CUIObject*>(iter)->Visible(bVisible);
|
||||
}
|
||||
m_bVisible = bVisible;
|
||||
}
|
||||
|
||||
CGameObject* CCanvasObject::Get_Panel(const wstring& Name)
|
||||
|
||||
@@ -61,17 +61,34 @@ _vector CElementObject::Get_WorldPostion()
|
||||
return m_pOwner->Get_WorldPostion();
|
||||
}
|
||||
|
||||
void CElementObject::Visible(_bool bVisible)
|
||||
{
|
||||
m_bActive = bVisible;
|
||||
}
|
||||
|
||||
_bool CElementObject::Chack_Visible()
|
||||
{
|
||||
if (m_pOwner->Get_Visible() == false )
|
||||
{
|
||||
m_bVisible = m_pOwner->Get_Visible();
|
||||
}
|
||||
else if (static_cast<CUIObject*>(m_pOwner)->Get_Active() == false)
|
||||
{
|
||||
m_bVisible = static_cast<CUIObject*>(m_pOwner)->Get_Active();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bVisible = m_bActive;
|
||||
}
|
||||
return m_bVisible;
|
||||
}
|
||||
|
||||
HRESULT CElementObject::Ready_Components(void* pArg)
|
||||
{
|
||||
__super::Ready_Components(pArg);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CElementObject::Visible(_bool bVisible)
|
||||
{
|
||||
Set_Visible(bVisible);
|
||||
}
|
||||
|
||||
void CElementObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
@@ -71,13 +71,7 @@ HRESULT CPanelObject::Ready_Element(void* pArg)
|
||||
|
||||
void CPanelObject::Visible(_bool bVisible)
|
||||
{
|
||||
if (m_Elements.empty())
|
||||
return;
|
||||
|
||||
for (auto iter : m_Elements)
|
||||
{
|
||||
static_cast<CUIObject*>(iter)->Visible(bVisible);
|
||||
}
|
||||
m_bActive = bVisible;
|
||||
}
|
||||
|
||||
CGameObject* CPanelObject::Get_Element(const wstring& Name)
|
||||
@@ -113,6 +107,19 @@ void CPanelObject::Add_Element(wstring Name, CGameObject* pPanel)
|
||||
m_iElements_Count++;
|
||||
}
|
||||
|
||||
_bool CPanelObject::Chack_Visible()
|
||||
{
|
||||
if (m_pOwner->Get_Visible() == false)
|
||||
{
|
||||
m_bVisible = m_pOwner->Get_Visible();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bVisible = m_bActive;
|
||||
}
|
||||
return m_bVisible;
|
||||
}
|
||||
|
||||
CGameObject* CPanelObject::Find_Element(const wstring& Name)
|
||||
{
|
||||
auto iter = m_Elements_map.find(Name);
|
||||
|
||||
@@ -145,11 +145,26 @@ void CUIObject::SizeUpdate_float(_float3 fSizeXY)
|
||||
m_fSizeY = fSizeXY.y;
|
||||
}
|
||||
|
||||
void CUIObject::Set_Time(_float fTime)
|
||||
{
|
||||
m_fTime = fTime;
|
||||
}
|
||||
|
||||
void CUIObject::Set_TimeMult(_float Mult)
|
||||
{
|
||||
m_fTimeMult = Mult;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_EndTime()
|
||||
{
|
||||
return m_fEndTime;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_DelayTime()
|
||||
{
|
||||
return m_fDelayTime;
|
||||
}
|
||||
|
||||
_float CUIObject::Get_TimeMult()
|
||||
{
|
||||
return m_fTimeMult;
|
||||
@@ -157,6 +172,7 @@ _float CUIObject::Get_TimeMult()
|
||||
|
||||
void CUIObject::Visible(_bool bVisible)
|
||||
{
|
||||
m_bVisible = bVisible;
|
||||
}
|
||||
|
||||
_bool CUIObject::Get_Visible()
|
||||
@@ -164,6 +180,16 @@ _bool CUIObject::Get_Visible()
|
||||
return m_bVisible;
|
||||
}
|
||||
|
||||
_bool CUIObject::Get_Active()
|
||||
{
|
||||
return m_bActive;
|
||||
}
|
||||
|
||||
_bool CUIObject::Chack_Visible()
|
||||
{
|
||||
return _bool();
|
||||
}
|
||||
|
||||
_float2 CUIObject::Get_Origin_Position()
|
||||
{
|
||||
return m_fOrigin_Posigion;
|
||||
|
||||
@@ -18,14 +18,16 @@ class ENGINE_DLL CElementObject abstract : public CUIObject
|
||||
virtual HRESULT Render();
|
||||
virtual _vector Get_WorldPostion() override;
|
||||
|
||||
public:
|
||||
virtual void Visible(_bool bVisible) override;
|
||||
virtual _bool Chack_Visible() override;
|
||||
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype();
|
||||
virtual HRESULT Initialize(void* pArg);
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
|
||||
public:
|
||||
virtual void Visible(_bool bVisible) override;
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
@@ -32,6 +32,7 @@ class ENGINE_DLL CPanelObject abstract : public CUIObject
|
||||
|
||||
protected:
|
||||
virtual void Add_Element(wstring Name, class CGameObject* pPanel);
|
||||
virtual _bool Chack_Visible() override;
|
||||
|
||||
protected:
|
||||
vector<class CGameObject*> m_Elements; // 패널이 엘리먼츠를 관리하기 위해 만듬
|
||||
|
||||
@@ -30,11 +30,16 @@ class ENGINE_DLL CUIObject abstract : public CGameObject
|
||||
virtual void MoveY(_float fY);
|
||||
virtual void SizeUpdate(_float fSizeX, _float fSizeY);
|
||||
virtual void SizeUpdate_float(_float3 fSizeXY);
|
||||
virtual void Set_Time(_float fTime);
|
||||
virtual void Set_TimeMult(_float Mult);
|
||||
virtual _float Get_EndTime();
|
||||
virtual _float Get_DelayTime();
|
||||
virtual _float Get_TimeMult();
|
||||
|
||||
virtual void Visible(_bool bVisible);
|
||||
virtual _bool Get_Visible();
|
||||
virtual _bool Get_Active();
|
||||
virtual _bool Chack_Visible();
|
||||
public:
|
||||
virtual _float2 Get_Origin_Position(); // Start Position
|
||||
virtual _vector Get_Current_Position(); // Current Position
|
||||
@@ -52,9 +57,16 @@ class ENGINE_DLL CUIObject abstract : public CGameObject
|
||||
_float m_fX{}, m_fY{}, m_fSizeX{}, m_fSizeY{};
|
||||
_float m_fWinSizeX{}, m_fWinSizeY{};
|
||||
|
||||
_bool m_bActive = { false }; // UI들이 켜질지 꺼질지
|
||||
_bool m_bHover = { false }; // UI들 위에 마우스가 올라가 있는지 확인
|
||||
_bool m_bAlpha = { false };
|
||||
|
||||
|
||||
_float m_fAlpha{}; // UI의 알파값을 조절해서 서서히 나오거나 서서히 사라지게 하기 위함
|
||||
_float m_fAlphaTime{}; // UI의 알파값을 조절 할 때 알파는 0~1이라서 n을 나누거나 곱해서 시간을 늘리거나 빠르게 하기 위함
|
||||
_float m_fTime{}; // 캔버스는 아니더라도 패널전체랑 Element들은 필요함
|
||||
_float m_fEndTime{}; // UI의 움직임이 끝나는 시간
|
||||
_float m_fDelayTime{}; // UI의 딜레이 시간
|
||||
_float m_fTimeMult{1.f}; // 애니메이션 속도를 조절하기 위해서 필요
|
||||
_float3 m_vScale{}; // UI의 스케일을 조절하기 위해서 필요함
|
||||
|
||||
|
||||
Reference in New Issue
Block a user