10 bool tempIsVertical =
false;
12 TazColor color = { 255, 255, 255, 255 };
24 tempIsVertical = m_isVertical;
31 void init()
override {
33 entity->isVertical = tempIsVertical;
36 void update(
float deltaTime)
override {
37 transform->size.x = entity->getParentEntity()->GetComponent<
TransformComponent>().size.x;
38 transform->size.y = entity->getParentEntity()->GetComponent<
TransformComponent>().size.y;
39 size_t childrenSize = entity->
children.size();
40 if (!entity->isVertical) {
42 entity->slotSpacing = transform->size.x / childrenSize;
44 entity->slotSpacing = transform->size.x;
48 entity->slotSpacing = transform->size.y / childrenSize;
50 entity->slotSpacing = transform->size.y;
57 batch.
draw(v_index, size, transform->getPosition(), transform->rotation, color);
60 std::string GetComponentName()
override {
61 return "PortComponent";
64 void showGUI(std::vector<BaseComponent*> otherComponents = {})
override {
65 showGUI(otherComponents, { entity });
68 void showGUI(std::vector<BaseComponent*> otherComponents, std::vector<Entity*> otherEntities)
override {
71 ImVec4 a_color = ImVec4(color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, color.a / 255.0f);
72 if (ImGui::ColorPicker4(
"TazColor", (
float*)&a_color)) {
74 (GLubyte)(a_color.x * 255),
75 (GLubyte)(a_color.y * 255),
76 (GLubyte)(a_color.z * 255),
77 (GLubyte)(a_color.w * 255)
79 for (
auto& ent : otherEntities) {
void draw(size_t v_index, const glm::vec2 &rectSize, const glm::vec3 &position, const glm::vec3 &mRotation, const TazColor &color)
draws are needed to convert the pos and size to vertices
Definition PlaneColorRenderer.cpp:87