diff options
Diffstat (limited to 'Runtime/GUI/UI9Slicing.cpp')
-rw-r--r-- | Runtime/GUI/UI9Slicing.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Runtime/GUI/UI9Slicing.cpp b/Runtime/GUI/UI9Slicing.cpp new file mode 100644 index 0000000..01a0143 --- /dev/null +++ b/Runtime/GUI/UI9Slicing.cpp @@ -0,0 +1,30 @@ +#include "UI9Slicing.h" + +UI9Slicing::UI9Slicing(ESlicing mode, Vector2 horizontal, Vector2 vertical, Vector2 texPixelSize, Vector2 size) +{ + m_Slicing = mode; + m_Horizontal = horizontal.Clamp(0, texPixelSize.x, 0, texPixelSize.x); + m_Vertical = vertical.Clamp(0, texPixelSize.y, 0, texPixelSize.y); + + if (m_Horizontal[0] + m_Horizontal[1] > texPixelSize.x || m_Vertical[0] + m_Vertical[1] > texPixelSize.y) + { + throw UIMeshException("UI9Slicing wrong parameter."); + } + m_TexSize = texPixelSize; + m_Size = size; +} + +void UI9Slicing::Draw() +{ + + + uint8* vb; + uint16* ib; + + g_SharedVBO.GetChunk(sizeof(UIVertexLayout), sizeof(uint16), 4, 6, Primitive_Triangle, (void**)&vb, (void**)&ib); + + + + g_SharedVBO.ReleaseChunk(4, 6); + g_SharedVBO.DrawChunk(UIMesh::s_UIVertexLayout); +} |